I know this question has been asked before, but I don't understand how to elements with margin:0
have had their margin 'collapse' - they've had their margin 'extended' to me (to a 15px
vertical gap between the two elements - <header>
& <nav>
.
Here is the HTML code I am using:
<div id="container">
<header>
<div class="logo">...</div>
</header>
<nav>
...
</nav>
</div>
and CSS styles:
#container {
width: 1178px;
margin: 0 auto;
background-color: #FFF;
}
header {
height: 102px;
background-color: #000;
background-image: url(images/header-bg.jpg);
margin: 0;
}
nav {
height: 51px;
background-image: url(images/navigation-bg.jpg);
background-repeat: repeat-x;
margin: 0;
}
.logo {
width: 268px;
height: 69px;
padding: 22px 0 0 31px;
margin: 0;
float: left;
}
jsfiddle here.