<div id="con" style="width: 800px;"> <div id="top"> Top </div> <div id="bund"> <div style="width: 48%; float: left;">A</div> <div style="width: 48%; float: left;">B</div> <div style="clear: both;"></div> </div> </div>
.clear{ clear: both; } .left{ width: 50%; background-color: green; float: left; } .right{ width: 50%; background-color: blue; float: right; }
<div class="clear"> <div class="left">Hey</div> <div class="right">dig<br />Med<br />dig</div> </div>
<div class="siteWrapper"> <div clas="logo"> <p>logo her</p> </div> <div class="header"> <p>header her</p> </div> <div class="left"> <p>Venstre div her</p> </div> <div class="right"> <p>højre div her</p> </div> </div>
div { margin: 10px; padding: 0px; } .siteWrapper { height: auto; width: 100%; } .logo { width: 100%; height: 100%; } .header { width: 100%; height: 100%; } .left { width: 50%; float: left; height: auto; } .right { width: 50%; height: auto; margin: auto auto; }
<html> <head> <style tyoe="text/css"> div { margin: 10px; padding: 0px; } .siteWrapper { height: auto; width: 100%; } .logo { width: 100%; height: 100%; } .header { width: 100%; height: 100%; } .left { width: 50%; float: left; height: auto; } .right { width: 50%; height: auto; margin: auto auto; } </style> </head> <body> <div class="siteWrapper"> <div clas="logo"> <p>logo her</p> </div> <div class="header"> <p>header her</p> </div> <div class="left"> <p>Venstre div her</p> </div> <div class="right"> <p>højre div her</p> </div> </div> </body> </html>
left and right vises ikke. hvorfor?