On Fri Jan 02 2015 at 11:32:20 AM Tom Livingston <tom...@gmail.com> wrote:

> I have the following structure:
>
> <body class="foo">
> <div class="main">
> <div class="constrained"></div>
> <div class="two"><div class="constrained"></div></div>
> <div class="two"><div class="constrained"></div></div>
> <div class="two"><div class="constrained"></div></div>
> <div class="constrained"></div>
> </div>
> </body>
>
> and these styles:
> .foo .main .constrained:first-of-type{padding-bottom:0;}
> .foo .main .two:first-of-type{padding-top:0;}
>
> the second rule doesn't work. Doesn't even show in the Chrome inspector.
> Not even as being over-written by something. However, this rule does work:
> .foo .main .constrained + .two{padding-top:0;}
>
> Is there an issue with having 2 :first-of-type rules like that?
>

I believe I've seen the error of my ways. Wasn't aware :first-of-type
doesn't take applied classes into account, so the second :first-of-type
rule above fails.

Please correct me if I am wrong.
______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to