本文共 555 字,大约阅读时间需要 1 分钟。
HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
html,body{
width:100%;
height:100%;
padding: 0px;
margin:0px;
}
.parent{
margin: 0;
width:100%;
height:500px;
position: absolute;
background-color:darkturquoise;
}
.child{
border:10px solid red;
margin:auto;
top:100px;
bottom:0px;
right:0px;
left:0px;
position: absolute;
background-color:white;
}
.child2{
border:15px solid black;
margin:auto;
top:0px;
bottom:0px;
right:0px;
left:0px;
position: absolute;
background-color:white;
}
效果图,兼容IE7~IE11,Chrome,Firefox
转载地址:http://ybpby.baihongyu.com/