Skip to content

Instantly share code, notes, and snippets.

Created June 1, 2012 05:03
Show Gist options
  • Save anonymous/2848961 to your computer and use it in GitHub Desktop.
Save anonymous/2848961 to your computer and use it in GitHub Desktop.
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
h1 span{
color:Red /* I only target <span> tags nested within a h1 */
}
h1 ~ span{
color:blue /* I dont taget <span> tags nest within a h1, but any <span> tag that follows a h1 on the same nested level */
}
<!--
The H1, span and h3, are all siblings
The spans within the h1, and h3, and descendants of their parent tags
-->
<h1>
<span>I am a descendant because I am nested within the h1</span>
</h1>
<span> I am a sibling, because I am at the same nested level as the h1</span>
<h3>
<span> I am not a sibiling of the h1, but I am a decedant of the h3</span>
</h3>
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment