I have a layout with 3 div's next to each other, but I want the middle div to be vertically aligned. What's the best way to achieve this?
[code=html]
<div id="titleContai ner">
<div id="titleLeft"> <img src="images/title.gif"></div>
<div id="titleRight" ><img src="images/code_grey.gif"> </div>
<h4>The Big Picture</h4>
<div class="clear"></div>
</div>
[/code]
[code=css]
.clear{
clear:both;
}
#titleContainer {
border-bottom:1px solid #CCC;
}
#titleContainer h4{
text-align:center;
font-size:14px;
font-style:italic;
color:#666;
float:left;
width:50%;
}
#titleLeft{
float:left;
width:25%;
}
#titleRight{
float:right;
}
[/code]
[code=html]
<div id="titleContai ner">
<div id="titleLeft"> <img src="images/title.gif"></div>
<div id="titleRight" ><img src="images/code_grey.gif"> </div>
<h4>The Big Picture</h4>
<div class="clear"></div>
</div>
[/code]
[code=css]
.clear{
clear:both;
}
#titleContainer {
border-bottom:1px solid #CCC;
}
#titleContainer h4{
text-align:center;
font-size:14px;
font-style:italic;
color:#666;
float:left;
width:50%;
}
#titleLeft{
float:left;
width:25%;
}
#titleRight{
float:right;
}
[/code]
Comment