Moderator |
|
Waarom werkt dit niet in IE?
Ik krijg een dubbele margin aan het begin van elke rij?!
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
body, div
{
border: 0;
margin: 0;
padding: 0;
}
.container
{
height: 530px;
width: 660px;
}
.block
{
float: left;
height: 150px;
width: 200px;
background-color: #cc00cc;
margin-left: 20px;
}
.goot
{
width: 660px;
height: 20px;
clear: both; /* ik zou hier ook float: left kunnen gebruiken */
}
</style>
</head>
<body>
<div class="container">
<div class="goot"><!-- no content --></div>
<div class="block"><!-- no content --></div>
<div class="block"><!-- no content --></div>
<div class="block"><!-- no content --></div>
<div class="goot"><!-- no content --></div>
<div class="block"><!-- no content --></div>
<div class="block"><!-- no content --></div>
<div class="block"><!-- no content --></div>
<div class="goot"><!-- no content --></div>
<div class="block"><!-- no content --></div>
<div class="block"><!-- no content --></div>
<div class="block"><!-- no content --></div>
<div class="goot"><!-- no content --></div>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <style type="text/css"> body, div { border: 0; margin: 0; padding: 0; } .container { height: 530px; width: 660px; } .block { float: left; height: 150px; width: 200px; background-color: #cc00cc; margin-left: 20px; } .goot { width: 660px; height: 20px; clear: both; /* ik zou hier ook float: left kunnen gebruiken */ } </style> </head> <body> <div class="container"> <div class="goot"><!-- no content --></div> <div class="block"><!-- no content --></div> <div class="block"><!-- no content --></div> <div class="block"><!-- no content --></div> <div class="goot"><!-- no content --></div> <div class="block"><!-- no content --></div> <div class="block"><!-- no content --></div> <div class="block"><!-- no content --></div> <div class="goot"><!-- no content --></div> <div class="block"><!-- no content --></div> <div class="block"><!-- no content --></div> <div class="block"><!-- no content --></div> <div class="goot"><!-- no content --></div> </div> </body> </html>
Sorry, Google power.
Oplossing: display: inline toevoegen.
|