Looking for a more efficient way to create a centered div with extended divs on either side reaching the page margin.
Currently, I am using two divs with 49% width each, and then placing a centered div on top of them to achieve the desired effect.
However, this method creates an awkward space below.
HTML:
<div id="green"></div>
<div id="red"></div>
<div id="blue"></div>
CSS:
#green {
height:25em;
width:49.99%;
background-color:#132a10;
display:inline-block;
margin:0;
float:left;
opacity:.47;
}
#red {
height:25em;
width:49%;
background-color:#400120;
display:inline-block;
margin:0;
opacity:.4;
}
#blue {
background-color:#436a97;
position:relative;
bottom:26em;
width:22em;
height:27em;
margin-right:auto;
margin-left:auto;
z-index:1;
opacity:;
}