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

 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.

---
</Abhimanyu>

Received on Thursday, 18 September 2014 13:20:07 UTC