< div id ="page" > <br> < div id ="left" > <br> <br> <br> </ div > <br> < div id ="right" > <br> <br> </ div > <br> </ div > <br><br> < div id ="main" > <br> < div class ="foot" > <br> < ul > <br> < li >< a href ="#" title =" " > </ a ></ li > <br> < li >< a href ="#" title ="" > </ a ></ li > <br> </ ul > <br> < div class ="contacts" > <br> < span class ="copy" > Copyright; © 2009 </ span > <br> </ div > <br> </ div > <br> <!-- --> <br> < div class ="img" >< img src ="img/back_001.jpg" width ="100%" alt ="" title ="" /></ div > <br> </ div > <br> <br> * This source code was highlighted with Source Code Highlighter .
- html {
- height : 100 % ;
- }
- body {
- margin : 0; padding : 0;
- height : 100 % ;
- }
- a {
- outline : none ;
- }
- / * Wrap pictures * /
- #main {
- position : relative ;
- z-index : 1 ;
- height : 100 % ;
- }
- / * The layer with the picture itself * /
- #main div .img {
- display : block ;
- position : absolute ;
- bottom : 0; / * picture will always be at the bottom of the page * /
- z-index : 10 ;
- min-width : 1000px ;
- width : 100 % ;
- _width : expression ( ( documentElement.clientWidth || document .body .clientWidth ) < 1004 ? '1004px' : '100%' ) ;
- }
- / * Layer with copyrights and bottom menu * /
- #main div .foot {
- position : absolute ;
- bottom : 80px ;
- z-index : 20 ;
- width : 100 % ;
- height : 30px ;
- min-width : 1000px ;
- _width : expression ( ( documentElement.clientWidth || document .body .clientWidth ) < 1004 ? '1004px' : '100%' ) ;
- }
- #main div .foot ul {
- list-style : none ;
- font : normal 12px Verdana;
- margin : 14px 0 0 75px ;
- padding : 0;
- }
- #main div .foot ul li {
- display : inline ;
- margin : 0 120px 0 0;
- }
- #main div .foot ul li a , #main div .foot ul li a : visited { color : #faffcd ; }
- #main div .foot ul li a : hover { color : # 163133 ; }
- #main div .contacts {
- position : absolute ;
- right : 44px ; top : 14px ;
- width : 360px ;
- font : normal 11px Verdana;
- color : #faffcf ;
- }
- / * Site itself * /
- #page {
- position : absolute ;
- top : 0; left : 0;
- z-index : 30 ;
- width : 100 % ;
- overflow : hidden ;
- margin : 0 0 300px 0;
- min-width : 1000px ;
- _width : expression ( ( documentElement.clientWidth || document .body .clientWidth ) < 1004 ? '1004px' : '100%' ) ;
- }
- #left {
- width : 290px ;
- float : left ;
- }
- #right {
- margin : 0 48px 0 370px ;
- position : relative ;
- color : # 4c4f51 ;
- font : normal 12px / 18px Verdana;
- }
- < script language = "javascript" >
- function test ( ) {
- var h = 400 + document. getElementById ( 'page' ) . offsetHeight ;
- if ( h > 600 ) {
- document. getElementById ( 'main' ) . style . height = h + 'px' ;
- }
- }
- </ script >
function test(){<br> var client = document .compatMode== 'CSS1Compat' && !window.opera? document .documentElement.clientHeight: document .body.clientHeight; ;<br> var h = 270 + document .getElementById( 'page' ).offsetHeight;<br> if (h > client) { <br> document .getElementById( 'main' ).style.height = h + 'px' ;<br> }<br> } <br><br> * This source code was highlighted with Source Code Highlighter .
<br>#main {<br> position: absolute;<br> top:0; left:0; right:0; bottom:0;<br> z-index: 1;<br> height:100%;<br>} <br><br> * This source code was highlighted with Source Code Highlighter .
Source: https://habr.com/ru/post/54651/
All Articles