如题所述
<style>
#wrap{
position:fixed;
top:50%;
left:0;
width:100%;
}
#cen{
position:relative;
height:200px;
top:-100px;
width:300px;
margin:0px auto;
}
</style>
<div id="wrap">
<div id="cen"></div>
</div>
#wrap{
position:fixed;
top:50%;
left:0;
width:100%;
}
#cen{
position:relative;
height:200px;
top:-100px;
width:300px;
margin:0px auto;
}
</style>
<div id="wrap">
<div id="cen"></div>
</div>
温馨提示:答案为网友推荐,仅供参考
第1个回答 2017-04-08
margin:0 auto;