Jump to content
  • 0

Дивы (ступор :()


kkthx
 Share

Question

У меня есть html:

<div id="center">
<div id="center0">
<div id="banner1"></div>
</div>
<div id="center1">
<div id="banner2"></div>
</div>
/div>
вот его css:
#center {
width: 595px;
background: #fafafa;

}
#center0 {
width: 395px;
float: left;
}
#banner1 {
width: 395px;
height: 316px;
background: red;
}
#center1 {
margin-left: 395px;
}
#banner2 {
width: 200px;
background: blue;
}

В opera, ie7, mozilla все блоки стыкуются как надо без лишних зазоров

В ie 6 блок center1 распологается под блоком center0, хотя визуально выглядят размеры правильно.

Подскажите как поправить код, чтобы и в ie6 нормально блоки распологались

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Попробуй так...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ru" xml:lang="ru">
<head>
<title>title</title>
<style type="text/css">
#center {
width: 599px;
background: #fafafa;
}
#banner1 {
float: left;
width: 395px;
height: 316px;
background: red;
}
#banner2 {
margin-left: 395px;
width: 200px;
height: 316px;
background: blue;
}
* html #banner2 {/*хак для ие*/
position:relative;
left:-3px;
margin-right:-3px;
}
</style>
</head>
<body>
<div id="center">
<div id="banner1">...</div>
<div id="banner2">...</div>
</div>
</body>
</html>

конечно хак, но что поделаешь ИЕ...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy