[英]Float:left does not give me the correct gallery I want
Currently trying to build a gallery page for a client's website and I've noticed that a simple float:left does not give me what i'm looking for. 当前正在尝试为客户的网站构建图库页面,我注意到一个简单的float:left并不能满足我的需求。
What I want is for the images to line up perfectly regardless of their size as the images that I have supplied are all in different sizes. 我想要的是无论尺寸大小如何都能使图像完美对齐,因为我提供的图像尺寸都不同。
.gallery img {
margin:0 !important;
border:1px solid white;
width:33%;
float:left;
}
That's the code that i'm using & the website is responsive. 那就是我正在使用的代码&网站具有响应能力。
use height: auto;
使用height: auto;
and max-width: 100%;
max-width: 100%;
.gallery img {
margin:0 !important;
border:1px solid white;
height: auto !important;
max-width: 100%;
float:left;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.