html - .css 页面切断页脚,不会滚动

标签 html css

每当我向页面添加相当数量的内容时,页面都不会滚动并且页脚会被截断。我尝试了其他问题的解决方案,但到目前为止对我没有任何帮助。有什么建议么?

html {
    overflow: hidden;
    height: 99%;
}

body {
    background: #ffffff;
    height: 99%;
    margin: 0;
    padding: 0;
    line-height: 150%;
    text-align: center;
}

* {
    font-size: 8pt; 
    font-family: Tahoma, Verdana, sans-serif; 
    color: #000000;
    text-align: left;
}

/* === Containers === */

#mainContentArea {
    margin: 0 auto 0 auto; 
    display: table; 
    height: 100%;  
    position: relative; 
    overflow: hidden; 
    width: 600px;
}

.link,.linkActive {
    width:75px;
    margin-right:10px;
    float: left;
    margin-top:24px;
    text-align:center;
    font-family:Georgia, "Times New Roman", Times, serif;
    background-image:url(tab.gif);
    position:relative; bottom:0px;
}

.link:hover { background-image:url(tab2.gif); }

a { text-decoration:none; }

.link a {
    font-family:Arial, Helvetica, sans-serif;
    font-size:12px;
    font-weight:bold;
}

#linkGroup {
    margin-right:10px;
    height:40px;
    width:600px;
}

#title {
    width:230px;
    height:40px;
    margin-right:20px;
    margin-top:15px;
    font-family:Verdana, Arial, Helvetica, sans-serif;
    font-size:20px;
    font-weight:bold;
    text-align:center;
    float:left;
}

.contentTitle {
    font-family:Verdana, Arial, Helvetica, sans-serif;
    color:#213E74;
    font-size:19px;
    margin-left:15px;
    margin-right:12px;
    margin-bottom:12px;
    width:573px;
}

.pageContent {
    font-family: Arial, Helvetica, sans-serif;
    color:#000000;
    font-size:12px;
    margin-left:20px;
    margin-right:20px;
    width:560px;
}


#blueBox {
    position: absolute;
    vertical-align: middle;
    background-color:#E7EDF8;
    width:600px;
    clear:both;
}

#header {
    width:600px;
    height:20px;
    background-color:#FFFFFF;
    background-image:url(header.gif);
    background-repeat:no-repeat;
}

#footer {
    width:600px;
    height:20px;
    background-color:#FFFFFF;
    background-image:url(footer.gif);
    background-repeat:no-repeat;
    text-align:center;
    padding-right:10px;
    color:#BDCDEC;
}

#footer a {
    font-size:9px;
    color:#BDCDEC;
}

#contentBox { margin-top:25px; }

html, body { text-align: center; }

p {text-align: left;}

最佳答案

看这个:

#mainContentArea {
    margin: 0 auto 0 auto; 
    display: table; 
    height: 100%;         # set the height to the same as the parent element
    position: relative; 
    overflow: hidden;     # hide (prevent scrolling) content that overflows
    width: 600px;
}

删除 overflow 指令,或将其设置为 auto 应该可以解决问题。

关于html - .css 页面切断页脚,不会滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10762326/

相关文章:

css - 边距在删除边框时崩溃

jquery - 隐藏和显示具有多个公共(public)类的 div

html - 我页面右侧的这个空间来自哪里?

html - CSS 菜单未正确对齐

php - HTML 表单的多个操作

html - 如何水平居中元素?

c# - Web 服务 (.net) 返回 html - 限制?

html - 使用宽度 : 100% 时页面一侧的空白区域

css - 重新调整窗口大小时图像失真(CSS)

html - 强制元素不水平拉伸(stretch)表格单元格