【问题标题】:div auto increase height not workingdiv自动增加高度不起作用
【发布时间】:2016-06-18 10:04:50
【问题描述】:

我已经在我的项目中尝试过这个,但是在这个 div 放大中遇到了一些问题。我需要停止 DIV 滚动条并使用浏览器滚动条进行全高滚动

home.php

<!DOCTYPE html>
<html>
<head>
    <title>Home</title>
    <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<script type="text/javascript" src="funcition.js"></script>
<div id="header">This is Header Section</div>
<div id="sider"></div>
<div id="full_page">
    <object data="test.php"></object>
</div>
<div id="footer">This Is footer section</div>
</body>
</html>

样式.css

#footer
{
    position: absolute;
    bottom: 0px;
}
#bo
{
    width: 200px;
    height: 1000px;
    background-color: red;
}
#full_page
{
    position: absolute;
    overflow: auto;
    max-height: 1000px;
}

test.php

<!DOCTYPE html>
<html>
<head>
    <title>Me</title>
    <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<script type="text/javascript" src="funcition.js"></script>
<div id="bo"></div>
</body>
</html>

【问题讨论】:

  • 您是否要放大#full_page 以占据页面的 100%?
  • #full_page 或 OBJECT 标记我需要删除 DIV 滚动条和 100% 的内容大小高度

标签: javascript html object


【解决方案1】:

请尝试这种风格。

#footer { position: absolute; bottom: 0px; z-index:99; }
#bo { width: 200px; height: auto; background-color: red; }
#full_page { height:auto; }

【讨论】:

    【解决方案2】:

    如果我是对的,答案很简单:

    #full_page{
        height: auto;
        overflow:none;
    }
    

    【讨论】:

    • 文档加载后到底发生了什么?
    • 页面加载时查看图片会激活滚动条
    • 你已经删除了 max-height:1000px;为了这个工作
    • #full_page { 高度:自动;溢出:无;背景颜色:蓝色; }
    • 好吧,然后试试这个:#full_page object { height: auto;溢出:无;背景颜色:蓝色; }
    猜你喜欢
    • 2018-06-03
    • 2014-07-21
    • 1970-01-01
    • 1970-01-01
    • 2014-11-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多