how to get the css floating property to work with four divs? I have four divs I would like to get algin using the layout as an example,
div One - div two
div Three - div Four
Here is what I attempted using the following css and html code but not lining up correctly.
<HTML>
<HEAD>
<TITLE>Layout Example</TITLE>
<link rel="stylesheet" type="text/css" href="file:///C:/app3/css/custom-theme/jquery-ui-1.8.16.custom.css">
<SCRIPT type="text/javascript" src="jquery-1.6.2.min.js"></SCRIPT>
<style>
.divs
{
width: 200px;
height: 200px;
}
#one
{
background-color: black;
float: left;
color: white;
}
#two
{
background-color: blue;
float: left;
}
#three
{
background-color: red;
float: none;
}
#four
{
background-color: green;
float: none;
}
</style>
</HEAD>
<BODY>
<div id="one" class="divs"> One </div>
<div id="two" class="divs"> Two</div>
<div id="three" class="divs"> Three </div>
<div id="four" class="divs"> Four </div>
</BODY>
</HTML>
Set them all to
float: leftandclear: both(orclear: left) the#thirdelement.http://jsfiddle.net/h2DHb/1/
Another alternative could be to make a
#container, with the overallheight/width: 400px, then set the.divsto beheight/width: 50%:http://jsfiddle.net/h2DHb/2/