Last active
May 13, 2019 09:07
-
-
Save petevb/9504f32de572a03fea77 to your computer and use it in GitHub Desktop.
[selectors for dummies] #css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* selectors for dummies | |
*/ | |
/* UNCOMMENT THE .a.a AND IT "TRUMPS" THE .a BELOW IT */ | |
/* I'm first, but have higher specificity (so not overridden)*/ | |
/*.a.a { | |
color: gold; | |
}*/ | |
/* A should be blue */ | |
.a { | |
color: blue; | |
} | |
/* I override blue above (to be red), but I can't beat the .a.a */ | |
.a { | |
color: red; | |
} | |
/* only A contained by A will be selected/green */ | |
.a .a { | |
color: green; | |
} | |
.itemsTable td p.tallRow { | |
color: red; | |
} | |
.tallRow.tallRow.tallRow { | |
color: gold; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="a">I'm just A</div> | |
<hr> | |
<div class="a">I'm A and container for another A <div class="a" >Contained A</div></div> | |
<hr> | |
<div class="a a">I'm A A and container for A<div class="a" >Contained A</div></div> | |
<hr> | |
<table class="itemsTable"> | |
<tbody> | |
<tr> | |
<td> | |
<p class="tallRow">omg</p> | |
</td> | |
</tr> | |
</tbody> | |
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// alert('Hello world!'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"view":"separate","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