12-12-2009, 20:22
Kod:
<html>
<head>
<title></title>
<style type='text/css'>
body {
margin:0;
padding:0;
}
#kontener {
width:500px;
height: 200px;
margin: 0 auto;
background-color:red;
border:0px solid;
}
#element {
width:200px;
margin: 20px auto;
background-color:green;
}
</style>
</head>
<body>
<div id="kontener">
<div id="element">element</div>
</div>
</body>
</html>
Po uruchomieniu powyższego kodu w Firefoksie div#kontener jest odsunięty od góry o 20px, a powinien być odsunięty tylko div#element.
Po dodaniu do #kontener border:1px solid wszystko jest wyświetlane prawidłowo. W IE ten problem nie występuje.
Czy jest to błąd Firefoksa i jest jakaś metoda na uniknięcie go?
Z góry dziękuję za pomoc