我在安卓上使用Chrome浏览器时,遇到了CSS的问题。
我的CSS如下:
html{
max-width: 100%;
height: 100%;
width: 100%;
overflow: hidden;
position: relative;
}
body{
background-color: rgba(101,122,151,0.8);
margin: 0px;
width: 100%;
overflow: hidden;
position: relative;
}
header {
width: 100%;
min-width: 100%;
color: yellow;
font-size: 40px;
text-align: left;
}
在 JavaScript 中,我输出了 body 和 header 的宽度。
alert($('header').width());
alert($('body').width());
它显示我的页面宽度为980,头部宽度为340,但我不明白为什么。有人可以帮忙吗?谢谢。