Skip to content

Instantly share code, notes, and snippets.

@jehoshua02
Created September 4, 2012 15:47
Show Gist options
  • Save jehoshua02/3622621 to your computer and use it in GitHub Desktop.
Save jehoshua02/3622621 to your computer and use it in GitHub Desktop.
margins are not additive ... seems to take the max margin of the two elements.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>margin test</title>
<style type="text/css">
.hello {
background-color: blue; margin-bottom: 8px;
}
.world {
background-color: red; margin-top: 8px;
}
</style>
</head>
<body>
<div class="hello" style="">hello</div>
<div class="world">world</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment