浮动div,100%高度

use*_*741 2 css height

Ť在此输入图像描述

*****{

    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    margin: 0;
    padding: 0;
    list-style: none;
}
Run Code Online (Sandbox Code Playgroud)

#footer-gradient {

    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 0 18px;
    margin-left: -18px;
    background: -moz-linear-gradient(top,  rgba(214,212,200,0.5) 0%, rgba(214,212,200,0.75) 25%, rgba(214,212,200,1) 50%, rgba(214,212,200,0.75) 75%, rgba(214,212,200,0.5) 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(214,212,200,0.5)), color-stop(25%,rgba(214,212,200,0.75)), color-stop(50%,rgba(214,212,200,1)), color-stop(75%,rgba(214,212,200,0.75)), color-stop(100%,rgba(214,212,200,0.5))); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top,  rgba(214,212,200,0.5) 0%,rgba(214,212,200,0.75) 25%,rgba(214,212,200,1) 50%,rgba(214,212,200,0.75) 75%,rgba(214,212,200,0.5) 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top,  rgba(214,212,200,0.5) 0%,rgba(214,212,200,0.75) 25%,rgba(214,212,200,1) 50%,rgba(214,212,200,0.75) 75%,rgba(214,212,200,0.5) 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(top,  rgba(214,212,200,0.5) 0%,rgba(214,212,200,0.75) 25%,rgba(214,212,200,1) 50%,rgba(214,212,200,0.75) 75%,rgba(214,212,200,0.5) 100%); /* IE10+ */
    background: linear-gradient(to bottom,  rgba(214,212,200,0.5) 0%,rgba(214,212,200,0.75) 25%,rgba(214,212,200,1) 50%,rgba(214,212,200,0.75) 75%,rgba(214,212,200,0.5) 100%); /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#80d4d2c6', endColorstr='#80d4d2c6',GradientType=0 ); /* IE6-9 */
    -moz-box-shadow:    inset 0 0 98px #a9a798;
    -webkit-box-shadow: inset 0 0 98px #a9a798;
    box-shadow:         inset 0 0 98px #a9a798;

}
Run Code Online (Sandbox Code Playgroud)

.col {

    margin-left: 0;
    float: left;
}
Run Code Online (Sandbox Code Playgroud)

.col:第一个孩子 {

    margin-left: 0;
}
Run Code Online (Sandbox Code Playgroud)

.footer {

    width: 33%;
    *width: expression(Math.floor(0.33 * (this.parentNode.offsetWidth - parseFloat(this.parentNode.currentStyle.paddingLeft) - parseFloat(this.parentNode.currentStyle.paddingRight))) + "px");
}
Run Code Online (Sandbox Code Playgroud)

.footer-left {

    background-color: red;
    height: 100% !important;
    min-height: 100% !important;
}
Run Code Online (Sandbox Code Playgroud)

.footer {

    background-color: red;
    height: 100% !important;
    min-height: 100% !important;
}
Run Code Online (Sandbox Code Playgroud)

我想让div.col拉伸到100%的高度.我尝试了很少的东西,但没有一个能解决这个问题.我指望你的帮助.

提前致谢 !

Ita*_*tay 11

  1. 设置三个元素的容器(#footer-gradient)display: table
  2. 并自己设置元素(.col)display: table-cell
  3. 删除浮动.
  4. 成功.

#footer-gradient {
    display: table;
}
#footer-gradient .col {
    display: table-cell;
    float: none;
}
Run Code Online (Sandbox Code Playgroud)