html - Why Chrome doesn't respect the margin properly? -


i search long , can't find answer :/

in chrome (internet explorer, konqueror, , many others) h1 margin @ bottom added .blue. however, firefox respect css rules properly.

any suggestion?

html

<div class="red"><div class="blue"><h1>hello world!</h1></div></div> 

css

.red{   background: red;   /* contain margins */   float:left;   /* padding-top:1px; */   /* display: inline-block */   /* overflow: hidden */ }  .blue{   background: blue;   min-height: 60px; }  h1{   margin: 10px 0 20px;   background: green; } 

gecko-based: [this 1 correct, guess]

enter image description here

webkit-based, khtml-based , trident shell:

enter image description here

codepen

http://codepen.io/marquex/pen/fzsik

the margin issue having related min-height rule in .blue div. replace height rule if possible same result in chrome , firefox.

i have no idea why happening when using min-height though. maybe kind of chrome's bug.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -