Sunday 15 February 2015

css - Stacking CSS3 Structural pseudo-classes -


While practicing various scenarios in which CSS3 pseudo-classes and selectors can be useful, I run into something Detect what I can not do!

Here's the position I want to modify the first non-empty paragraph : first-of-type :: first-letter for the block of text. I'm not sure whether the pseudo classes can be stacked though. Here's what I came up with (does not work, of course)

 . Colonel-Body & gt; P: No (: empty): first-of-the-type :: first letter {...}  

Looking at the following markup:

  Lt; Div class = "article-body" & gt; & Lt; P & gt; & Lt; / P & gt; & Lt; P & gt; "T" in this article should be affected. & Lt; / P & gt; & Lt; / Div & gt;  

The only estimate is that I can not stack on pseudo-orbits (i.e. :: no () and: first-type types).

Any ideas for how this can be accomplished?

: type of first first P selects , as the name suggests, not previously non-empty p as you wish.

It's okay, but : first-type of is going on purely tags (i.e. type), not on the preceding complex selector . So you are looking for the first P , and that first paragraph should not be blank. And that does not exist.

Below the empty paragraphs, you can appear in the entire lesson, and you want to influence only the first, blank-less paragraphs, I do not think it's possible to do this, a selector is the best one. With which I can come:

  p: first-of-type :: first-letter, page: empty + p :: first letter {text-conversion: uppercase; / * ... * /} p: no (: empty) ~ p: first letter {text-conversion: heirs; / * Reset * /}  

This will only apply first empty-empty paragraph to CSS (well, and on the first empty paragraph, but still nothing will do so).


No comments:

Post a Comment