1. HTML code
1 <Body>2 <Divclass= "header">3 </Div>4 5 <!--Header Placeholder Element -6 <Divclass= "Header-place"></Div>7 <!--Header placeholder Element-end -8 9 <Divclass= "Container">Ten </Div> One A <!--Footer Placeholder Elements - - <Divclass= "Footer-place"></Div> - <!--Footer Placeholder Element-end - the - <Divclass= "Footer"> - </Div> - </Body>
2, SCSS (SASS) code
1 $header _height:4rem;2 $footer _height:5rem;3 4 . Header{5 width:100%;6 Height:$header _height;7 Line-height:$header _height;8 position:fixed;9 Z-index:999;Ten} One A . Header-place{ - width:100%; - Height:$header _height; the Line-height:$header _height; -} - - . Footer{ + width:100%; - Height:$footer _height; + position:fixed; A Z-index:999; at} - - . Footer-place{ - width:100%; - Height:$footer _height; -}
How mobile web-solves the fixed layout of headers and footer