1. 程式人生 > >頭部和底部固定,中間內容可滾動

頭部和底部固定,中間內容可滾動

html+css的程式碼的展示<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><title>上下固定,中間內容可以滾動</title><styletype="text/css"> html,body,.page{width:100%; height:100%;overflow:hidden;}.top,.con,.bottom{position:absolute; left:0; right:0;}.top{top:0;z-index:1;height:30px;
background:#ff0;}
.con{top:30px; bottom:40px; overflow:auto;}.bottom{bottom:0;z-index:1; height:40px;background:#00f;}</style></head><body><divclass="wrap"><divclass="top">頭部</div><divclass="con">中間內容<br/> 中間內容<br/> 中間內容<br/> 中間內容<br/> 中間內容<br/>
中間內容<br/> 中間內容<br/></div><divclass="bottom">底部內容</div></div></body></html>