I am struggling with a common issue and despite searching, I have not been able to find a solution that works for me. Here is my setup:
<div id="wrapper">
<div class="content-area-top"></div>
<div class="content-area">
<h1>Title</h1>
some other text
</div>
</div>
.content-area-top {
height: 12px;
width: 581px;
background-image: url(images/content-top.jpg);
}
.content-area {
margin-left: 10px;
margin-right: 10px;
background-color: #e9ecfd;
}
The issue is that there is a noticeable gap between .content-area-top and .content-area. The .content-area-top div is specifically sized to accommodate a background image that helps achieve the desired rounded corners.
I believe this problem is caused by the default top margin set on the H1 tag (.67em), but I prefer not to remove this margin setting. It is puzzling why the margin seems to extend 'outside' its containing div.
I use Chrome on Mac, but Firefox exhibits the same issue. While there may be well-known fixes for this, none seem to align perfectly with my scenario.