这也是突然发现的。为什么 在html中设置 padding-top:100就有效果呢?希望有人给于解答。
以下是代码
<
!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 >
< title >Qhis 2008 </title>
< style type ="text/css" >
* {
padding: 0px;
margin: 0px;
}
html,body{
background:#FFFFFF;
height: 100%;
width: 100%;
}
html{
padding-top: 77px;
}
#E1{
position: absolute;
width: 100%;
height: 57px;
background: Aqua;
z-index: 1;
top: 0px;
}
#E2{
position: absolute;
width: 100%;
height: 20px;
background: Blue;
z-index: 1;
top: 57px;
}
#E3{
width: 100%;
height:100%;
background: #ff0;
}
</style>
</head>
< body >
< div id ="E1" > </div>
< div id ="E2" > </div>
< div id ="E3" >sddsfsdff </div>
</body>
</html>
< html xmlns ="http://www.w3.org/1999/xhtml" >
< head >
< title >Qhis 2008 </title>
< style type ="text/css" >
* {
padding: 0px;
margin: 0px;
}
html,body{
background:#FFFFFF;
height: 100%;
width: 100%;
}
html{
padding-top: 77px;
}
#E1{
position: absolute;
width: 100%;
height: 57px;
background: Aqua;
z-index: 1;
top: 0px;
}
#E2{
position: absolute;
width: 100%;
height: 20px;
background: Blue;
z-index: 1;
top: 57px;
}
#E3{
width: 100%;
height:100%;
background: #ff0;
}
</style>
</head>
< body >
< div id ="E1" > </div>
< div id ="E2" > </div>
< div id ="E3" >sddsfsdff </div>
</body>
</html>
转载于:https://blog.51cto.com/oyoyo/71899