I have the following layout:
HTML:
<div class="test">
<div class="a"> test</div><div class="b">test2</div>
<div class="a"> test</div><div class="b">test2</div>
<div class="a"> test</div><div class="b">test2</div>
<div class="a"> test</div><div class="b">test2</div>
<div class="a"> test</div><div class="b">test2</div>
<div class="a"> test</div><div class="b">test2</div>
</div>
CSS:
.test .a,.test .b {
float: left;
width: 100px;
}
.test .a:nth-child(4n+1) , .test .b:nth-child(4n+2) {
background: lightgreen;
}
.test .b:after {
clear: both;
display: block;
content: "\a";
}
it does not reset float
after .b
;
what I tried to acheive is two column list like
test test2
test test2
test test2
test test2
where both columns have fixed width
Is here any way to acheive my goal using only CSS ? (no html markup change)