Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets#Limitations" rel="noreferrer">According to Wikipedia</a>:</p> <blockquote> <p><strong>Selectors are unable to ascend</strong> </p> <blockquote> <p>CSS offers no way to select a parent or ancestor of element that satisfies certain criteria. A more advanced selector scheme (such as XPath) would enable more sophisticated stylesheets. However, the major reasons for the CSS Working Group rejecting proposals for parent selectors are related to browser performance and incremental rendering issues.</p> </blockquote> </blockquote> <p>And for anyone searching SO in future, this might also be referred to as an ancestor selector.</p> <p><strong>Update:</strong> </p> <p>The <a href="http://www.w3.org/TR/2011/WD-selectors4-20110929/#subject" rel="noreferrer">Selectors Level 4 Spec</a> allows you to select which part of the select is the subject:</p> <blockquote> <p>The subject of the selector can be explicitly identified by prepending a dollar sign ($) to one of the compound selectors in a selector. Although the element structure that the selector represents is the same with or without the dollar sign, indicating the subject in this way can change which compound selector represents the subject in that structure.</p> <p><strong>Example 1:</strong></p> <p>For example, the following selector represents a list item LI unique child of an ordered list OL:</p> <pre><code>OL &gt; LI:only-child </code></pre> <p>However the following one represents an ordered list OL having a unique child, that child being a LI:</p> <pre><code>$OL &gt; LI:only-child </code></pre> <p>The structures represented by these two selectors are the same, but the subjects of the selectors are not.</p> </blockquote> <p>Although this isn't available (currently, November 2011) in any browser or as a selector in jQuery.</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. 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.
 

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