I want to hide (display:none) the first div with class .leftAddress
Here is css
fieldset .leftAddress:first-of-type{
display:none;
}
Here is html
<fieldset>
<div class="alert forward"><span class="coming"><strong>NOTE:</strong></span> A maximum of 5 address book entries allowed.</div>
<div class="leftAddress">Any</div>
<div class="leftAddress">
<!--Insert-->
<h3 class="addressBookDefaultName">Harry Testing</h3>
</div>
<div class="leftAddress">
<!--Insert-->
<h3 class="addressBookDefaultName">Heba ElZany</h3>
</div>
<div class="leftAddress">
<!--Insert-->
<h3 class="addressBookDefaultName">Yamen Shahin (primary address)</h3>
</div>
<div class="leftAddress">
<!--Insert-->
<h3 class="addressBookDefaultName">Yamen2 Shahin2</h3>
</div>
<div class="leftAddress">
<!--Insert-->
<h3 class="addressBookDefaultName">Yamen3 Shahin3</h3>
</div>
</fieldset>
As you see I used :first-of-type
, but it seems to be not working. What am I missing here?
I also tried :nth-of-type(1) http://jsfiddle.net/arns7/4/ it doesn't work.
So this solution didn't work for me CSS selector for first element with class