[英]I have html,body and container div set to 100% height yet there is still a gap at top of page?
@charset "utf-8";
html {
height:100%;
} }
body {
background-color:#000000;
height:100%;
}
img
{ border-style: none;
}
container {
background: #EEE;
position:relative;
width:763px;
margin:auto;
min-height:100%;
border-right: 2px solid #0F0;
border-left: 2px solid #0F0; position:inherit;}
whats the deal guys? 那些家伙怎么办? is it cause of the utf-8 i read it can leave a no width vertical gap, idk kinda shooting in the dark.
是因为我读过utf-8的原因,它会在垂直方向留下空白宽度,idk有点在黑暗中射击。
You have set the content height to 100%, but not removed the default margin (or padding in some browsers). 您已将内容高度设置为100%,但未删除默认边距(在某些浏览器中为空白)。 This means that the content is the height of the viewport, and you get scrollbars so you can reach the bottom of it.
这意味着内容是视口的高度,您将获得滚动条,以便可以到达其底部。
Set: 组:
html,
body {
margin: 0;
padding: 0;
}
to remove the default margin/padding. 删除默认的边距/填充。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.