Code: Select all
<div class="container">
<div id="dv1">Div 1</div>
<div id="dv2">Div 2</div>
</div>
How to do that with css?
Code: Select all
<div class="container">
<div id="dv1">Div 1</div>
<div id="dv2">Div 2</div>
</div>
Code: Select all
<style>
.container {
position:relative;
text-align:center;
}
#dv1, #dv2 {
display:inline-block;
width:30%;
margin:0 4px;
background:#33f;
}
</style>
<div class="container">
<div id="dv1">Div 1</div>
<div id="dv2">Div 2</div>
</div>