Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you're OK with using CSS3 selectors, try using these (grouped together):</p> <pre><code>/* Select the first child if it's not a .quote */ article &gt; p:not(.quote):first-child:first-letter, /* Or, if the first child is a .quote, select the following one instead */ article &gt; p.quote:first-child + p:first-letter { float: left; font-family: Georgia, serif; font-size: 360%; line-height: 0.85em; margin-right: 0.05em; } </code></pre> <p><a href="http://jsfiddle.net/BoltClock/kZ7u9" rel="nofollow">See the jsFiddle demo</a></p> <p>Otherwise I think you'll have to play with some overrides to get the desired effect.</p> <h3>Some explanation</h3> <p>The <a href="http://www.w3.org/TR/css3-selectors/#negation" rel="nofollow">negation pseudo-class <code>:not()</code></a> is always processed <strong>independently</strong> of all other types, IDs, classes and pseudo-classes in the compound selector. This is regardless of how you arrange it with your other selectors.</p> <p>To put it another way: you can't use <code>:not()</code> to remove, or filter out, elements that match what's in the negation, from a selection matched by the rest of the simple selector. It also means that the set of the elements matched by the <code>:*-child()</code> and <code>:*-of-type()</code> pseudo-classes is not affected by <code>:not()</code>.</p> <p>So the first selector above,</p> <pre><code>article &gt; p:not(.quote):first-child:first-letter </code></pre> <p>works roughly like this:</p> <ol> <li><p>Find every <code>p</code> element.</p> <ul> <li>If not found, ignore. <br /><br /></li> </ul></li> <li><p>If found, check whether this <code>p</code> is the <code>:first-child</code> <strong>and</strong> if it's <code>:not(.quote)</code>.</p> <ul> <li>If it's not the first child, ignore.</li> <li>If it has the <code>quote</code> class, ignore. <br /><br /></li> </ul></li> <li><p>If it matches both pseudo-classes, check whether this <code>p</code> is a child of <code>article</code>.</p> <ul> <li>If not, ignore. <br /><br /></li> </ul></li> <li><p>If so, grab its <code>:first-letter</code>.</p></li> <li><p>Apply rules.</p></li> </ol> <p>The second selector, on the other hand, is relatively straightforward:</p> <pre><code>article &gt; p.quote:first-child + p:first-letter </code></pre> <p>All it does is take the <code>p</code> that comes right after the first child of <code>article</code> if it's a <code>p.quote</code>, and apply rules to its <code>:first-letter</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload