[英]Aligning last div elements
我试图使用text-align-last
属性对齐上一个div元素,但是它不起作用。 我的中心有很多div ,但是我的页面在每个分辨率上都不同,因此我无法控制元素是否会完美,而且它们中的任何一个都不在最后一行左右,所以这就是为什么要将它们向左对齐。
小提琴: http : //jsfiddle.net/ecn8c0pt/
我的网站图片:
尝试将样式添加到CSS中,如下所示:
float:left; min-width: 200px; max-width: 200px;
并尝试固定包装div
标签的width
例如:
.wrapper { width:1000px; }
请参见示例DEMO,并在控制好运气时尝试预测宽度!
添加以下CSS将起作用。
http://jsfiddle.net/ecn8c0pt/1/
#gallery h2{
margin: 0;
height: 80px; /*Added height for the Heading */
font-size: 1.1em;
font-weight: 300;
color: #33CCFF;
}
.project{
display: inline-block;
margin: 0 15px 40px;
width: 156px; //To show in jsfiddle i reduced the width.
text-align: left;
float: left; //MUST CHANGE: Once you align left it will automatically float to left. Also the number of count per row will depends on the window width and div width.
}
.project .thumbnail{
width: 156px;//To show in jsfiddle i reduced the width.
height: 144px;
border-radius: 3px;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.