Javascript-форум (https://javascript.ru/forum/)
-   (X)HTML/CSS (https://javascript.ru/forum/xhtml-html-css/)
-   -   Позиция поля DIV (https://javascript.ru/forum/xhtml-html-css/16351-poziciya-polya-div.html)

vah-smile 05.04.2011 04:50

Позиция поля DIV
 
Извините за нубовский вопрос, но всеже: Как выровлять нижнее поле DIV с самого низу страницы, но так, чтобы оно не выходило на остальные элементы?

Пример: http://a-smile.narod.ru/data/div_pos.htm Нужно сделать так, чтобы оранжевое поле не заходило на синее но была резина!

<div style="width: 100%; height: 300px; background-color: #3300FF; position: absolute; Left: 0px; TOP: 0px;"></div>
<div style="width: 100%; height: 100px; background-color: #CC9933; position: absolute; Left: 0px; Bottom: 0px;"></div>

ksa 05.04.2011 08:47

Цитата:

Сообщение от vah-smile
Как выровлять нижнее поле DIV с самого низу страницы, но так, чтобы оно не выходило на остальные элементы?

Как вариант...

<!DOCTYPE html>
<html>
<head>
<style type="text/css">
* {
	margin: 0;
	padding: 0;
}
html,
body {
	width: 100%;
	height: 100%;
}
#container {
	position: relative;
	min-height: 100%;
}
#footer_tab {
	height: 100px;
	claer: both;
}
</style>
<script type="text/javascript">
</script>
</head>
<body>
<div id='container'>
	<div style="width: 100%; height: 300px; background-color: #3300FF;"></div> 
	<div id='footer_tab'></div>
	<div style="width: 100%; height: 100px; background-color: #CC9933; position: absolute; Left: 0px; Bottom: 0px;"></div>
</div>
</body>
</html>

vah-smile 07.04.2011 17:03

Спасибо, ksa!


Часовой пояс GMT +3, время: 12:03.