Created
November 20, 2017 09:15
-
-
Save ferdiemmen/1e466cbf1205dec8b0c3de54f4a432f1 to your computer and use it in GitHub Desktop.
Fix margin on child element not visible on parent
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="style.css"> | |
<script src="script.js"></script> | |
<style> | |
#parent { | |
width: 100%; | |
background: red; | |
overflow: hidden; | |
} | |
#child { | |
background: green; | |
margin: 20px 0; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="parent"> | |
<div id="child">foobar</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment