Created
March 25, 2011 13:46
-
-
Save Gekkio/886846 to your computer and use it in GitHub Desktop.
Don't use width: 100% on block-level elements unless you know exactly what you're doing!
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
<html> | |
<body> | |
<div style="background-color: red; margin: 20px; width: 100%"> | |
Fail (margin: 20px; width: 100%) | |
</div> | |
<div style="background-color: red; margin: 20px"> | |
Success (margin: 20px) | |
</div> | |
<div style="background-color: red; padding: 20px; width: 100%"> | |
<div style="background-color: green"> | |
Fail (padding: 20px; width: 100%) | |
</div> | |
</div> | |
<div style="background-color: red; padding: 20px"> | |
<div style="background-color: green"> | |
Success (padding: 20px) | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment