根据屏幕分辨率调整页面,例如缩放时的stackoverflow 问题和css布局在放大时会失真。我是css的新手,我面临的第一个也是非常大的问题是当我放大或缩小页面时会失真。我想做一些事情,比如我的页面适合每个分辨率。请给我这样的解决方案,我可以在整个页面上应用,包括正文和页脚
HTML:
<div class="wrap">
<div id="head">
<div id="head_back">
<b id="logo">LOGO</b>
<div id="nav">
<b>2000</b>
<b>2001</b>
<b>2002</b>
<b>2004</b>
</div>
</div>
</div>
</div>
CSS:
.wrapper{width:100%; background-color:red; overflow:auto; margin:0; padding:0;}
#head
{
width:100%; height:100px;
color:#902df3;
position:relative;
top:-10px;
left:-7.8px;
font-family:"Arial Black", Gadget, sans-serif;
padding-right:17px;
}
#head #head_back
{
position:absolute;
line-height:90px;
top:0;
left:0;
width:100%;
height:100px;
background:#999; background-size:cover; background-repeat:no-repeat;
}
#head #logo
{
font-size:46px;
position:absolute;
}
#head #nav
{
font-size:26px;
position:absolute;
left:60%;
}
body html
{
position: fixed;
width: 100%;
overflow:scroll;
}