Jump to content
  • 0

3 резиновых колонки на DIV


brainiac
 Share

Question

Всем привет! Помогите пожалуйста поправить код так, чтобы он был не таким тупым (далее поймёте, почему).

Нужно внутри блока #ban-about-news расположить 3 блока: #banner (занимает 50% страницы), #about (25% страницы) и #news (25% страницы).

HTML-код страницы:

<div id="ban-about-news">
<div id="banner">
<img src="swf/banner.png" width="100%" alt="БАННЕР">
</div>
<div id="about">
<h1>ЗАГОЛОВОК БЛОКА ABOUT</h1>
<p>Текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст.</p>
<p>Текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст.</p>
<p>Текст текст текст текст текст текст текст.</p>
</div>
<div id="news">
<h2>НОВОСТИ</h2>
<p><div class="news-date">20.02.10</div></p>
<p>Текст новости, текст новости, текст новости, текст новости, текст новости, текст новости, текст новости.</p>
<p><div class="news-date">10.02.10</div></p>
<p>Тест новости, текст новости, текст новости, текст новости, текст новости, текст новости.</p>
</div>
</div>

CSS-код:

#ban-about-news {
border: #00F dashed;
width: 100%;
position: absolute;
}
#banner {
width: 50%;
max-width: 700px;
min-width: 350px;
float: left;
}
#about {
position: absolute;
top: 0;
left: 50%;
background-color: #f1f1f1;
width: 25%;
font-size: 90%;
font-family: Arial, Helvetica, sans-serif;
padding: 10px;
}
#about h1 {
background-color: #ffffff;
padding: 5px;
font-family: Arial, Helvetica, sans-serif;
font-size: 110%;
color: #f7941e;
}
#news {
position: absolute;
top: 0;
left: 77%;
}
#news h2 {
background-color: #1255a6;
color: #FFF;
font-family: Arial, Helvetica, sans-serif;
padding-left: 25px;
}
.news-date {
color: #999;
margin-bottom: -10px;
}

Кое-что из стилей выкинуто. Важно: чтобы блоки #about и #news занимали 100% высоты блока #ban-about-news. А высота последнего зависела от #about и #news.

Я уже всю голову сломал. То одно наезжает, то другое выпирает… Вся надежда на этот форум.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

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