Skip to content

Instantly share code, notes, and snippets.

@thomaswrenn
Last active August 29, 2015 14:13
Show Gist options
  • Save thomaswrenn/83dd06e4d9f5f721fe27 to your computer and use it in GitHub Desktop.
Save thomaswrenn/83dd06e4d9f5f721fe27 to your computer and use it in GitHub Desktop.
GgWvLK
<div class="example" id="one">
<div class="parent" id="one">
Parent
<div class="child" id="one">
Child
<div class="grandchild" id="one">
Grandchild
</div>
<div class="grandchild" id="two">
Grandchild
</div>
</div>
</div>
</div>
<div class="example" id="two">
<div class="parent" id="one">
Parent
<div class="child" id="one">
Child
<div class="grandchild" id="one">
Grandchild
</div>
<div class="grandchild" id="two">
Grandchild
</div>
</div>
</div>
</div>
<div class="example" id="one">
<div class="parent" id="one">
Parent<br/>Test
<div class="child" id="one">
Child
<div class="grandchild" id="one">
Grandchild
</div>
<div class="grandchild" id="two">
Grandchild
</div>
</div>
</div>
</div>
<div class="example" id="two">
<div class="parent" id="one">
Parent<br/>Test
<div class="child" id="one">
Child
<div class="grandchild" id="one">
Grandchild
</div>
<div class="grandchild" id="two">
Grandchild
</div>
</div>
</div>
</div>
#parent {
background: red;
}
#child {
background: blue;
}
html {
position: relative;
}
.example {
padding: 10px;
.parent,
.child,
.grandchild {
padding: 5px;
color: white;
}
.parent {
background: red;
position: relative;
}
.child {
background: blue;
}
.grandchild {
&#one {
background: #440;
}
&#two {
background: orange;
}
}
&#one {
.child {
/* position: relative;*/
.grandchild {
&#one {}
&#two {
position: absolute;
top: 70px;
}
}
}
}
&#two {
.child {
position: relative;
.grandchild {
&#one {}
&#two {
position: absolute;
top: 50px;
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment