Jump to content
  • 0

Максимальная высота у div


prowoke
 Share

Question

Есть код:


*{
margin:0px;
padding:0px;
}
html,body{
height:100%;
}
#body{
position:relative;
margin:0px auto;
width:1000px;
min-height:100%;
overflow:hidden;
}
#content{
margin:0px 0px 0px 310px;
min-height:100%;
background:#ddd;
height: 100%;
}
#left{
position:relative;
float:left;
padding-bottom:30px;
width:300px;
background:#999;}
#footer{
position:absolute;
left:0px;
right:0px;
bottom:0px;
height:30px;
background:#bbb;}

Есть структура:


<div id="body">
<div id="left">
left
</div>

<div id="content">
content
sda выап выа
п ывап
ыва п
выа
gdsf
g
dsf
g вы
а п
выа <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
</div>

<div id="footer">
footer
</div>

</div>


Как сделать, чтобы #content всегда растягивался до footer. Я уже второй раз подобный вопрос задаю, но первый раз я решил проблему по другому, да так и не надо это особо было. А вот теперь надо. В общем помогите. Если ставишь height: 100%; То это ведь совсем другое, он просто начинается тянуться в зависимости от контента, находящегося в нём.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

ну вообще-то там футер всегда внизу и будет в не зависимости от того сколько контента

Эт да. Но я спрашивал как рястунть контент до футера. Чтобы заливка цветом была на всю страницу, а не только на ту высоту, которая растянута из-за содержимого контента.

Link to comment
Share on other sites

  • 0

Эт да. Но я спрашивал как рястунть контент до футера. Чтобы заливка цветом была на всю страницу, а не только на ту высоту, которая растянута из-за содержимого контента.

Копипастить код сюда не буду, решение здесь.

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