Miguel Migou Miguel Migou - 4 months ago 24
CSS Question

Div above content?

I'm working on a newsletter so I have to make 2 columns and I used 2 divs at 50% of

width
to do it.
But the problem is that the div on the right goes above the content.

How could I fix that please? Thank's

Here is the fiddle



#yellow {
background-color: rgb(214, 196, 0);
width: 100%;
margin-bottom: auto;
}
#yellowL {
float: left;
width: 50%;
}
#yellowR {
position: relative;
float: right;
width: 50%;
}
#h1v2 {
color: rgb(67, 153, 186);
background-color: rgb(214, 196, 0);
}

<div id="yellow">
<h1 id="h1v2">Geschäftsverlauf / Déroulement des affaires</h1>
<div id="yellowL">
<h1 id="h1v2">Offerten</h1>
<p>

</p>
<h1 id="h1v2">Projekte</h1>
<p>

</p>
</div>
<div id="yellowR">
<h1 id="h1v2">Offres</h1>
<h2>Bruit</h2>
<p>

</p>
<h2>Sols</h2>
<p>

</p>
<h2>Déchets</h2>
<p>

</p>
<h2>EIE</h2>
<p>

</p>
<h2>Physique et acoustique du bâtiment</h2>
<p>

</p>
<h1 id="h1v2">Projets</h1>
<h2>Bruit</h2>
<p>

</p>
</div>
</div>




Answer

add overflow: hidden; to your #yellow css rule

#yellow {
    background-color: rgb(214, 196, 0);
    width: 100%;
    margin: auto;
    overflow:hidden;
}