Help with a pseudo-class, first-child
Posted
by zac
on Stack Overflow
See other posts from Stack Overflow
or by zac
Published on 2010-04-29T20:28:45Z
Indexed on
2010/04/29
20:37 UTC
Read the original article
Hit count: 390
css
|pseudo-class
I am working on a CMS platform with limited access to the template files and want to try and control some of the layout with pseudo class but no luck yet. Can anyone see what is wrong with this structure and why my pseudo class is being ignored?
<div id="main">
<div class="someRandomDiv"></div>
<div class="block">
stuff
</div>
<div class="block">
more stuff
</div>
</div>
and i am trying something like this
#main .block {border: 1px solid blue}
#main .block:first-child {border: 1px solid red}
so with this example I would think the stuff block would have a red border and more stuff would have a blue but it is all just blue.
Thanks for any help with this.
© Stack Overflow or respective owner