brainfreeze
Registered
Целта ми е да float-на два div-a в един parent div, но се получава нещо, което не мога да проумея, както и да разбера къде греша.
Ето ми го HTML-a:
и CSS-a:
Ето и какво се получава: (натиснете в/у изображението)
На практика двата diva са в parent-a, но както виждате не личи. Под IE проблема го няма, но под Mozilla & Opera е налице. Нямам идея защо така се получава и какво бъркам.
Thanks in advance!
Ето ми го HTML-a:
Код:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Floating divs</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="style.css" />
</head>
<body>
<div id="container">
<div id="div_1">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>
<div id="div_2">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>
</div>
</body>
</html>
и CSS-a:
Код:
* {
margin: 0;
padding: 0;
}
#container {
margin: 0 auto;
width: 800px;
border: 5px solid red;
}
#div_1 {
width: 350px;
background-color: blue;
color: white;
float: left;
}
#div_2 {
width: 350px;
background-color: green;
color: white;
float: left;
}
Ето и какво се получава: (натиснете в/у изображението)
На практика двата diva са в parent-a, но както виждате не личи. Под IE проблема го няма, но под Mozilla & Opera е налице. Нямам идея защо така се получава и какво бъркам.
Thanks in advance!