Can someone help me with a CSS issue I'm experiencing?
Here is my code:
<div class='test'>
<div>test 1</div>
<div>test 2</div>
</div>
<div class='test'>
<div>test 3</div>
<div>test 4</div>
</div>
<div class='test'>
<div>test 5</div>
<div>test 6</div>
</div>
I am trying to style the first test div with a red background and the rest with blue backgrounds using this CSS:
.test{
background-color: blue;
margin: 15px;
border-top: dashed 1px grey;
}
.test:first-of-type{
background-color: red;
border-top:0;
}
However, all my divs are displaying with blue backgrounds. Am I missing something? Any help would be appreciated. Thank you!