Skip to content

Instantly share code, notes, and snippets.

@jakebresnehan
Forked from anonymous/dabblet.css
Created June 1, 2012 07:58
Show Gist options
  • Save jakebresnehan/2850099 to your computer and use it in GitHub Desktop.
Save jakebresnehan/2850099 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":"separate","fontsize":"80","seethrough":"","prefixfree":"1","page":"result"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment