Created
April 5, 2013 12:58
-
-
Save xem/5319091 to your computer and use it in GitHub Desktop.
vertical margins and paddings depend on the parent's width. Are there other CSS properties that do the same?
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
/* vertical margins and paddings depend on the parent's width. Are there other CSS properties that do the same? */ | |
div.out { | |
width: 800px; | |
height: 400px; | |
overflow: hidden; | |
background: #abc; | |
} | |
div.in { | |
width: 10%; /* = 80px */ | |
height: 10%; /* = 20px */ | |
margin: 10%; /* = 80px 80px 80px 80px */ | |
padding: 10%; /* = 80px 80px 80px 80px */ | |
background: #dcb; | |
} |
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="out"> | |
<div class="in"> | |
Wat. | |
</div> | |
</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","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