take a look at this Code. i want the Left & Right Box (DIVs) to appear in one line.. how to do it
+1
A:
<div><div style="float:left">a</div> <div style="float:left">b</div></div>
<div style="clear:both"></div>
Orbit
2010-10-27 18:12:06
i did this, but now my borders are not aligned in a straight line http://jsfiddle.net/ayqyn/
Junaid Saeed
2010-10-27 18:23:39
A:
Float both the left and right divs to the left and clear the footer. You will also need to adjust the widths of the left and right divs for them to fit on the same line.
#left
{
position:static;
width: 40%;
height: 50px;
margin-top: 10px;
margin-right: 10px;
background: #111111;
border: solid 3px #ff0000;
float: left;
}
#right
{
position:static;
width: 40%;
height: 50px;
margin-top: 10px;
margin-right: 10px;
background: #111111;
border: solid 3px #ff0000;
float: left;
}
#footer
{
position: static;
width : 100%;
height : 50px;
margin-top: 10px;
background: #111111;
border: solid 3px #ff0000;
text-align: center;
clear: both;
}
CuriousCurmudgeon
2010-10-27 18:18:13
i did, but now my borders are not aligned in a straight line http://jsfiddle.net/ayqyn/
Junaid Saeed
2010-10-27 18:22:23
You are setting the width of the header to 100%, which is 300px. When you then add the border it is added to the outside of this div. This means that the actual width of your header is 300 + 2*3 = 306px. You will need to decide if you want your borders within the container or not and adjust your widths accordingly.
CuriousCurmudgeon
2010-10-27 18:42:12