>웹 프론트엔드 >HTML 튜토리얼 >全屏显示 在IE7下body会有滚动条出现_html/css_WEB-ITnose

全屏显示 在IE7下body会有滚动条出现_html/css_WEB-ITnose

WBOY
WBOY원래의
2016-06-24 12:03:491247검색

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>demo-非全屏-使用box-sizing:content-box</title><style>*{padding:0;margin:0;border:none;}body{width:100%;height:100%;overflow:hidden;}.pr{position:relative;}.pa{position:absolute;}.pf{position:fixed;}.of-h{overflow:hidden;}.of-a{overflow:auto;}.of-s{overflow:scroll;}.wrap{width:100%;height:100%;}.header{width:100%;height:100px;background:#ccc;z-index:1;}.content{width:100%;height:auto;top:100px;bottom:100px;background:#03C;z-index:0;}.footer{bottom:0;width:100%;height:100px;background:#ccc;z-index:1;}</style></head><body class="pa"><div class="wrap pr" style="width:90%;margin:0 auto;">    	<div class="header pa of-h">header 高度100px z-index:1</div>    	<div class="content pa of-a">        	<div>content z-index:0<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />...<br />content z-index:0<br /></div>        </div>    	<div class="footer pa of-h">footer 高度100px z-index:1</div></div></body></html>


大伙看看哪里出问题了,是代码问题还是ie7就是这样子的?


回复讨论(解决方案)

给html添加同样的样式

html,body{width:100%;height:100%;overflow:hidden;}

给html添加同样的样式

html,body{width:100%;height:100%;overflow:hidden;}


感谢
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.