我想知道为什么导航div不占据100%的高度

用户名

我有一个示例页面,如下所示

HTML代码:

   <div class="container">
        <div class="header floatL width100p">
            <h2>
                Header
            </h2>
        </div>
        <div class="content floatL width100p">
            <div class="floatL width29p npv">
                <p>navigation div</p>
            </div>
            <div class="floatL width70p rtb">
                <div class="floatL width100p ql">
                    <p>
                        div one
                    </p>
                    <p>Lorem Ipsum is simply dummy text of        the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s
                    </p>
                </div>
                <div class="floatL width100p mtbs">
                    <p>
                        div two
                    </p>
                    <p>
                        Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s
                    </p>
                </div>
                <div class="floatL width100p widdiv">
                    <div class="floatL width100p">
                        <div class="floatL width40p incont">
                            <p>
                            Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the     industry's standard dummy text ever since the 1500s
                            </p>
                            <p>
                            Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the     industry's standard dummy text ever since the 1500s
                            </p>
                            <p>
                            Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the     industry's standard dummy text ever since the 1500s
                            </p>
                            <p>
                            Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the     industry's standard dummy text ever since the 1500s
                            </p>
                        </div>
                        <div class="floatL width40p incont">
                            <p>
                            Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the     industry's standard dummy text ever since the 1500s
                            </p>
                        </div>
                    </div>
                    <div class="floatL width100p">
                        <div class="floatL width40p incont">
                            <p>
                            Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the     industry's standard dummy text ever since the 1500s
                            </p>
                            <p>
                            Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the     industry's standard dummy text ever since the 1500s
                            </p>
                            <p>
                            Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the     industry's standard dummy text ever since the 1500s
                            </p>
                            <p>
                            Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the     industry's standard dummy text ever since the 1500s
                            </p>
                        </div>
                        <div class="floatL width40p incont">
                            <p>
                            Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the     industry's standard dummy text ever since the 1500s
                            </p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="clear"></div>

        </div>
        <div class="footer floatL width100p">
            <h2>
                Footer
            </h2>
        </div>
        <div class="clear"></div>
    </div>

样式是:

       *,html{
            margin: 0;
            padding: 0;
        }
        .container{
            width:960px;
            margin:20px auto;
        }
        .header h2,.footer h2{
            text-align: center;
        }
        .floatL{
            float: left;
        }
        .floatR{
            float: right;
        }
        .clear{
            clear:both;
        }
        .width100p{
            width: 100%;
        }
        .width29p{
            width: 29%;
        }
        .width70p{
            width: 70.8%;
        }
        .header,.footer,.content{
            border:1px solid;
        }
        .npv{
            border-right: 1px solid;
            height: 100%;
        }
        .ql,.mtbs{
            border-bottom: 1px solid;
        }
        .width40p{
            width: 40%;
        }

        .incont{
            margin: 4%;
            background: #ccc;
            border:1px solid red;

        }

我想知道为什么左导航div不能占据100%的高度,如通过运行上面的代码可以看到的那样。

任何帮助,将不胜感激。迫在眉睫...

丹尼尔

使用 css tables

小提琴

的CSS

.content
{
    display: table;
    height: 100%;
}
.npv, .rtb
{
   display: table-cell; 
}

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

JS Slider涵盖了我的导航div-不知道为什么

来自分类Dev

我想知道为什么我的程序没有在我的 while 循环中停止

来自分类Dev

我的Keylistener不起作用,我想知道为什么

来自分类Dev

想知道为什么我的代码无法删除我想要的任何号码?

来自分类Dev

我想知道为什么我必须使用Ajax打印在WordPress中使用的变量

来自分类Dev

想知道为什么我的JQuery数组循环未正确设置我的href

来自分类Dev

我想知道为什么我的代码在 XML 信息之间产生空白行?

来自分类Dev

我想知道为什么模板方法可以调用非模板方法?

来自分类Dev

我想知道为什么魔术函数会为特定运算符提供特定答案

来自分类Dev

我想知道为什么dist文件夹的大小比src的角度大?

来自分类Dev

我想知道为什么Clojure中不评估代码的优点是数据

来自分类Dev

想知道为什么我的GUI检查按钮功能不起作用?

来自分类Dev

想知道为什么我的带捕鼠器的Createjs会变慢。(提供了jsfiddle)

来自分类Dev

我想知道为什么模板方法可以调用非模板方法?

来自分类Dev

我想知道为什么这段代码不起作用?

来自分类Dev

我正在测试 ArrayBuffer 并想知道为什么结果是这样的:

来自分类Dev

div不占据屏幕宽度的100%

来自分类Dev

我只是想知道为什么以下代码在执行时不会出现分段错误

来自分类Dev

导航菜单是透明的,但我不知道为什么。我要背景

来自分类Dev

Twitter-Bootstrap4:使 DIV 占据高度(100% - 导航栏)

来自分类Dev

我想知道为什么我不能将我的文本与代码中的变量连接起来。我该如何解决此代码?

来自分类Dev

在派生类的字段中运行的代码顺序是什么?我想知道为什么得到此输出,我听不懂

来自分类Dev

在代码的最后一行中,我尝试进行投射,但返回null。我的意思是选择=空。我想知道为什么以及如何解决它

来自分类Dev

html div不占据浏览器的全部高度

来自分类Dev

我想知道为什么当我移动播放器时,同时是精灵的播放器和气球都口吃

来自分类Dev

我想知道为什么我的前几千个结果正确,然后在cuda编程中得到了旧值?

来自分类Dev

我想知道为什么我用jquery ajax(django,jquery)发送一个数组来查看时发生错误

来自分类Dev

jQuery的新手,想知道为什么.hide()无法正常工作

来自分类Dev

SetTimeout在FireFox中不起作用,但在IE中很好,想知道为什么吗?

Related 相关文章

  1. 1

    JS Slider涵盖了我的导航div-不知道为什么

  2. 2

    我想知道为什么我的程序没有在我的 while 循环中停止

  3. 3

    我的Keylistener不起作用,我想知道为什么

  4. 4

    想知道为什么我的代码无法删除我想要的任何号码?

  5. 5

    我想知道为什么我必须使用Ajax打印在WordPress中使用的变量

  6. 6

    想知道为什么我的JQuery数组循环未正确设置我的href

  7. 7

    我想知道为什么我的代码在 XML 信息之间产生空白行?

  8. 8

    我想知道为什么模板方法可以调用非模板方法?

  9. 9

    我想知道为什么魔术函数会为特定运算符提供特定答案

  10. 10

    我想知道为什么dist文件夹的大小比src的角度大?

  11. 11

    我想知道为什么Clojure中不评估代码的优点是数据

  12. 12

    想知道为什么我的GUI检查按钮功能不起作用?

  13. 13

    想知道为什么我的带捕鼠器的Createjs会变慢。(提供了jsfiddle)

  14. 14

    我想知道为什么模板方法可以调用非模板方法?

  15. 15

    我想知道为什么这段代码不起作用?

  16. 16

    我正在测试 ArrayBuffer 并想知道为什么结果是这样的:

  17. 17

    div不占据屏幕宽度的100%

  18. 18

    我只是想知道为什么以下代码在执行时不会出现分段错误

  19. 19

    导航菜单是透明的,但我不知道为什么。我要背景

  20. 20

    Twitter-Bootstrap4:使 DIV 占据高度(100% - 导航栏)

  21. 21

    我想知道为什么我不能将我的文本与代码中的变量连接起来。我该如何解决此代码?

  22. 22

    在派生类的字段中运行的代码顺序是什么?我想知道为什么得到此输出,我听不懂

  23. 23

    在代码的最后一行中,我尝试进行投射,但返回null。我的意思是选择=空。我想知道为什么以及如何解决它

  24. 24

    html div不占据浏览器的全部高度

  25. 25

    我想知道为什么当我移动播放器时,同时是精灵的播放器和气球都口吃

  26. 26

    我想知道为什么我的前几千个结果正确,然后在cuda编程中得到了旧值?

  27. 27

    我想知道为什么我用jquery ajax(django,jquery)发送一个数组来查看时发生错误

  28. 28

    jQuery的新手,想知道为什么.hide()无法正常工作

  29. 29

    SetTimeout在FireFox中不起作用,但在IE中很好,想知道为什么吗?

热门标签

归档