I am trying to create a very simple 2 column layout with floating div in html. The problem is that the following div , foot always displayed to the right of the div right . I know that I have to use the clear statement somewhere, but I'm not sure if this is the right place.
In addition, as you can see on the left, I explicitly indicated the height of the left . Is there a way to set the right force to the same height without specifying it again?
<div id="main"> <div id="left" style="float: left; width: 150px; background: #DDDDDD; height: 500px;"> left column </div> <div id="right" style="float: left; background: #EEEEEE;"> right column </div> </div> <div id="foot"> footer </div>
source share