Skip to content

Instantly share code, notes, and snippets.

@chrsr
Created May 10, 2012 06:32
Show Gist options
  • Save chrsr/2651460 to your computer and use it in GitHub Desktop.
Save chrsr/2651460 to your computer and use it in GitHub Desktop.
Strange Chrome Dev Tools margin behaviour...
<!DOCTYPE html>
<html>
<body>
<div style="width: 100px; height: 100px; margin-right: 30px; background: blue;">
<div style="width: 50px; height: 50px; margin: 0; background: red;">
</div>
</div>
<div style="width: 50px; height: 20px; background: green;">
</div>
</body>
</html>
@chrsr
Copy link
Author

chrsr commented May 10, 2012

Pull this up in Chrome Dev Tools and inspect the blue div. What is going on with the margin inspection?

@latpaw
Copy link

latpaw commented May 10, 2012

What is happening

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment