How would you align two divs next to each other, with one of them centered within the container?
I'm trying to figure out how to position the second div right beside the first one and have it expand to the right. Any ideas?
Check out this example :
Here's the HTML:
<div id="container" >
<div id="div1"> </div>
<div id="div2"></div>
</div>
And here's the CSS:
#container{ width: 100%;
display:inline;
height:60px;
color:#000;
}
#div1{ margin-left:auto;
margin-right:auto;
width:200px;
height:50px;
background-color:#333;
}
#div2{ float:right;
width:100%;
height:50px;
background-color:#ccc;
}
Thank you!