Re: [css-inline-nth-child()] Adding nth-child functionality in inline styling?

On Thu, Sep 18, 2014 at 6:19 AM, abhimanyu0003
<abhimanyu@japanaddicts.org> wrote:
> I can't add a nth-child(n) declaration while applying inline styles to an
> element (which, obviously, contains multiple elements).
>
> For example, suppose I have a div that contains three p elements.
>
> The general stylesheet rules would go like this:
>
> div p:nth-child(2) {   color: blue; }
>
> But what if I need to colour the second paragraph blue while applying an
> inline style to the containing div? Should we add this functionality?
> Because if you say "just apply a style to the second p element for God's
> sake," then I don't really agree that it's a good solution. Suppose the
> content of the div is dynamically updated and we just need the second p to
> be blue, what now?
>
> In other words, should targetting child selectors with inline styles be
> accepted?
>
> In yet other words, should we trash the virginity of inline styles? An
> inline style necessarily targets just one element: on whom it's been
> applied. That's pretty much why it's an inline style. It makes perfect
> sense. But well, when I look at the problem I gave at the top, I think we
> need something here.

Can you give more of an example? I can't figure out what you're
talking about, unfortunately. :/

~TJ

Received on Thursday, 18 September 2014 17:29:48 UTC