... a big drawback - fixed height ...
< div id = "wrap" >
< div id = "main" >
If User Calls <br>
then be squabbled; <br>
If spam in Outlook crashed early, <br>
Then colleagues miss today, <br>
And users do not bother them. <br>
< / div >
< / div >
< div id = "footer" >
When it's still half a century before dinner <br>
Loop my keyboard knocks endlessly, <br>
Mouse clicks silence breathing <br>
The monitor is frozen attention. <br>
Personal life turns into codes <br>
In thoughts only WORK, WORK. <br>
If at leisure without sleep and care <br>
I want to hurry to work again, <br>
Then the software virus has taken you <br>
And there is no fight of desire and strength, <br>
And urgently, I don’t forget to say: <br>
End if; <br>
End loop; <br>
End if; <br>
End if;
< / div >
* {
margin : 0 ;
padding : 0 ;
/ * You can refrain from commenting on such a reset of styles,
in the example it is easier to show like this *
}
')
html , body {
height : 100 % ;
}
#wrap {
position : relative ;
min-height : 100 % ;
background-color : #ccc ;
}
* html #wrap {
height : 100 % ;
/ * Take out the styles for IE to a separate file or do it as you like,
here everything is mixed up for clarity * /
}
#main {
/ * css * /
}
#footer {
position : relative ;
background-color : # dcd8cb ;
zoom : 1 ; / * Solves some problems in IE6-7, in particular the problem with the display of bg-color * /
}
function resize ( ) {
var foot = document. getElementById ( 'footer' ) ;
var footHeight = foot. offsetHeight ;
foot. style . marginTop = - footHeight + "px" ;
document. getElementById ( 'main' ) . style . paddingBottom = footHeight + "px" ;
}
window. onload = resize ;
, , .
<noscript >
<style type = "text / css" >
#main {
padding-bottom : 80px ;
}
#footer {
min-height : 80px ;
margin-top : -80px ;
}
* html #footer {
height : 80px ;
}
</ style >
</ noscript >
Source: https://habr.com/ru/post/67040/
All Articles