I have been debating using css with div's and laying out elements, and really am looking to see if the practice i've been using would be considered the best practice, or if there is something different that i'm over looking that would be better.
Lets say we were placing two images on the same line, on on the left one on the right then an text in the ad below it. I might do something like:
#container{
width:800px;
height:300px;
}
.fleft{
float:left;
}
#left_img_container{
float:left;
width:150px;
}
#right_img_container{
float:right;
width:150px;
text-align:right;
}
#textArea{
margin-top:5px;
width:100%;
}
<div id='container'>
<div class='fleft'>
<div id='left_img_container'>FOO IMAGE 1</div>
<div id='right_img_container'>FOO IMAGE 2</div>
</div>
<div class='fleft' id='textArea'>this is my text</div>
</div>
Simple example but illistrates the float kind of layout style. Is this the better practice? or would using clear be better?
Thanks in advance