It's weird but when I use the :last-child to my elements, and then put a clearfix div in the end, it breaks the last-child? Any ideas anyone?
HTML:
<div>
<a href="#">first child</a>
<a href="#">second child</a>
<a href="#">third child</a>
<a href="#">last/forth child</a>
<div class="clearfix"></div>
This is after the clearfix
</div>
CSS:
a{
display: block;
margin: 5px;
color: red;
width: 80px;
float: left;
}
a:last-child{
color: blue;
}
.clearfix:before, .clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}