Как заставить трюк с нижним колонтитулом работать в IE 8? - PullRequest
1 голос
/ 23 марта 2009

Я использую это:

body {font-size:12px; font-family:"trebuchet MS", verdana, arial, sans-serif; background: #CCCCCC; word-wrap:break-word; height: 100%; margin: 0; padding: 0;
}

#wrapper {
    text-align: left;
    height:auto;
    height: 100%;
    margin: 0 auto -200px; /* the bottom margin is the negative value of the footer's height */
    padding: 0px;
    border:0;
    width: 1000px;
    background: #FFFFFF;


.footer, .push {
    height: 200px; /* .push must be the same height as .footer */
    position:absolute;
}

Похоже, что он отлично работает в Firefox / Safari / Opera и IE 6 и 7, но не в 8. Что отсутствует или нет?

1 Ответ

3 голосов
/ 24 марта 2009

В вашем коде были большие дыры, поэтому мне пришлось немного угадать. Вы можете проверить это, похоже, он работает на ff3, ie7 и ie8, которые я тестировал.

Я не уверен, что это то, что вы хотели, но вы действительно должны предоставить лучший пример с вашим вопросом.

<!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">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>test</title>
    <style type="text/css">
html{
    height:100%;
    margin: 0; 
    padding: 0;
}
body {
    font-size:12px; font-family:"trebuchet MS", verdana, arial, sans-serif; 
    background: #CCCCCC; 
    word-wrap:break-word; 
    height: 100%; 
    margin: 0; 
    padding: 0;
}

#wrapper {
    text-align: left;
    height:auto;
    height: 100%;
    margin: 0 auto -200px; /* the bottom margin is the negative value of the footer's height */
    padding: 0px;
    border:0;
    width: 1000px;
    background: #FFFFFF;
}

.footer, 
.push {
    height: 200px; /* .push must be the same height as .footer */
    position:absolute;
    bottom:0;
    background:red;
}

    </style>
</head>
<body>
    <div id="wrapper">Lorem</div>
    <div class="footer">Footer jabba jibba jubba hubba bubba dubba dibba dei</div>
</body>
</html>

Надеюсь, это поможет.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...