Created
June 30, 2016 05:06
-
-
Save oldergod/ec8403175b762aba9d24a5ebe1636d4e to your computer and use it in GitHub Desktop.
CSS Coding Tips: Inheritance
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
/** | |
* CSS Coding Tips: Inheritance | |
*/ | |
div { | |
margin-top: 50px; | |
position: relative; | |
border: 1px solid black; | |
background: pink; | |
} | |
div::before { | |
content: ''; | |
position: absolute; | |
top: -.4em; | |
left: 1em; | |
padding: .35em; | |
background: inherit; | |
border: inherit; | |
border-right: 0; | |
border-bottom: 0; | |
transform: rotate(45deg); | |
} |
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>Some text</div> |
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":"split-vertical","fontsize":"80","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment