[personal profile] ex_awakened208 posting in [community profile] style_system
Is there any way I can target the first .separator-before on a page of entries if I'm using For The Bold? I can't seem to nail it using .first-child but I might not be using the right code.

Date: 2013-03-14 12:47 pm (UTC)
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
From: [personal profile] afuna
Slightly complicated, but try this:

.entry-wrapper:nth-of-type(2) .separator-before { ... }

it's nth-of-type(2) instead of 1, because it's the second div in there (previous/next navigation is the first div). You need to target .entry-wrapper because that's the outermost relevant wrapper (if you try to target .separator-before:first-child, it will always match because it's always the first-child within an entry wrapper!)

Date: 2013-03-14 01:09 pm (UTC)
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
From: [personal profile] afuna
You're welcome!

Not sure it's helpful

Date: 2013-03-14 01:07 pm (UTC)
ninetydegrees: Art: self-portrait (Default)
From: [personal profile] ninetydegrees
The way I understand it :first-child works if you have several elements with the name name within the same container --with nothing else between them too I think-- like if you had several .separator-before in .entry-wrapper. For example you can do with .separator because there are two (.entry-wrapper .separator:first-child {border: 1px solid #ff00ff;}).

You might be luckier using :nth-of-type. Maybe something like:

.entry-wrapper:nth-of-type(2) .separator-before {
}

This doesn't feel right but it worked for me. I'm not sure this is it, though.

Edit: sorry for the double comment; I took too long to answer. :)
Edited Date: 2013-03-14 01:08 pm (UTC)

Profile

Dreamwidth style system discussion

July 2025

S M T W T F S
  123 45
6789101112
13141516171819
20212223242526
2728293031  

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 12th, 2025 07:52 pm
Powered by Dreamwidth Studios