I'm having issues with clearing margins using :nth-of-type(3n+3)
. If I use any div or anything it upsets the counting of items. Any ideas as to why this might be happening and what I can do to work around it?
CSS
.clear{
clear: both;
/* overflow acts the same as clear */
/* overflow: hidden; */
width: 100%;
background-color: blue;
}
div.row{
width: 700px;
background-color: #000;
overflow: hidden;
}
div.one-of-three{
width:200px;
float: left;
margin-right:50px;
background-color: #ff0000;
}
.one-of-three:nth-of-type(3n+3){
margin-right: 0;
}
HTML
<div class="row">
<div class="one-of-three">one-of-three</div>
<div class="one-of-three">one-of-three</div>
<div class="one-of-three">one-of-three</div>
<div class="clear">div divider</div>
<!-- <div>blank div does the same thing - just not as visible for debugging</div> -->
<div class="one-of-three">one-of-three</div>
<div class="one-of-three">one-of-three</div>
<div class="one-of-three">one-of-three</div>
</div>