I have 2 field sets inside a form tag called myform
I’m trying to get to the first fieldset. Now before the fieldsets there are other divs and p tags.
I was trying this for the first fieldset and last
<myform>
<div></div
<p></p>
<fieldset></fieldset>
<div></div>
<fieldset></fieldset>
</myform>
#myform fieldset{
// all round styles for the fieldset
}
#myform:first-child fieldset{
// specific to the first field set
}
#myform:last-child fieldset{
specific to the last filedset
}
Your html is incorrect.
<myform></myform>should be<form id="myform"></form>and the proper selector is
#myform fieldset:first-of-typeThis page is a good reference on how css pseudo-classes work