我想在不更改 HTML 的情况下对齐黑色列下的红色列:
是否有任何 jquery 或 css 解决方案?
CSS:
.col{
width: 25%;
border: 1px solid black;
margin: 10px;
padding:2px;
float:left;
}
.clear{clear:both;}
.col1{height: 200px;}
.col2{height: 300px;}
.col3{height: 200px;}
.col4{height: 200px; border: 1px solid red;}
.col5{height: 220px; border: 1px solid red;}
.col6{height: 120px; border: 1px solid red;}
HTML:
<div class="col col1">1</div>
<div class="col col2">2</div>
<div class="col col3">3</div>
<div class="clear"></div>
<div class="col col4">4</div>
<div class="col col5">5</div>
<div class="col col6">6</div>