Last active
January 4, 2016 16:15
-
-
Save michsch/5570267 to your computer and use it in GitHub Desktop.
CSS nested selectors
This file contains hidden or 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
/** | |
* CSS nested selectors | |
*/ | |
body { | |
font-family: Arial, verdana, sans-serif; | |
font-size: 20px; | |
color: black; | |
} | |
.content .rot { | |
color: #ff0000; | |
} | |
.link-with-icon-wrapper { | |
width: 200px; | |
} | |
.link-with-icon { | |
display: block; | |
text-align: center; | |
text-decoration: none; | |
} | |
.link-with-icon:after { | |
content: '↓'; | |
display: block; | |
} |
This file contains hidden or 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="content"> | |
<p>Dieser Text ist schwarz!</p> | |
<p class="rot">Dieser Text ist rot!</p> | |
<p class="link-with-icon-wrapper"><a class="link-with-icon" href="#">Mein Link</a></p> | |
</div> | |
<p class="rot">Dieser Text ist schwarz, auch wenn er die Klasse "rot" hat.</p> |
This file contains hidden or 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 hidden or 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":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment