Часто стоит задача сделать так чтоб футер был всегда внизу страницы.
Решение очень простое...
html, body {height: 100%;} #wrap {min-height: 100%;} #main {overflow:auto; padding-bottom: 150px;} /* must be same height as the footer */ #footer {position: relative; margin-top: -150px; /* negative value of footer height */ height: 150px; clear:both;} /*Opera Fix*/ body:before {/* thanks to Maleika (Kohoutec)*/ content:""; height:100%; float:left; width:0; margin-top:-32767px;/* thank you Erik J - negate effect of float*/ }
Для любимо ИЕ добавляем следующий код:
<!--[if !IE 7]> <style type="text/css"> #wrap {display:table;height:100%} </style> < ![endif]-->
Ну и сама страница:
<div id="wrap"> <div id="main"> </div> </div> <div id="footer"> </div>
Источник: http://www.cssstickyfooter.com/
#1 by alxcube on 31.10.2011 - 23:21
а как футер растянуть на всю ширину? а-то у меня чего-то поля примерно по 5пкс остаются..
#2 by pulev on 31.10.2011 - 23:22
xhtml.kiev.ua/2011/01/27/...s-reset-css-v-2/
#3 by Soil on 26.07.2011 - 18:27
Работает
#4 by Max on 09.04.2011 - 13:12
Спасибо огромное, все рабоает!
#5 by Максим on 16.12.2009 - 15:39
работает
#6 by алекс on 11.09.2009 - 12:59
не работает