css - float div,100% 高度

标签 css height

t enter image description here

***** {

    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    margin: 0;
    padding: 0;
    list-style: none;
}

#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;

}

.col {

    margin-left: 0;
    float: left;
}

.col:first-child {

    margin-left: 0;
}

.footer {

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

.footer-left {

    background-color: red;
    height: 100% !important;
    min-height: 100% !important;
}

.footer {

    background-color: red;
    height: 100% !important;
    min-height: 100% !important;
}

我想让 div.col 拉伸(stretch)到 100% 高度。我尝试了一些方法,但都没有解决问题。我指望你的帮助。

提前致谢!

最佳答案

  1. 设置三个元素的容器(#footer-gradient)display: table
  2. 并设置元素本身 (.col) display: table-cell
  3. 去除 float 。
  4. 成功。
<小时/>
#footer-gradient {
    display: table;
}
#footer-gradient .col {
    display: table-cell;
    float: none;
}

关于css - float div,100% 高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19091048/

相关文章:

css - wordpress 子主题 styles.css 不想覆盖父 style.css

jquery - 如何制作一个固定的横幅,让内容流过它?

html - 为什么在设置按钮 :after { content }? 时随机得到字符串 "Ã-"而不是 "×"

html - 如何使 parent 高度与 child 相关,但当 child 高度增加时也不增加 parent 高度

javascript - 如何更改所选链接的背景?

html - 通过 SVG 将图像添加到列表中

css - 无法正确调整导航至 100% 的高度

javascript - 使用 CSS 调整 CodeMirror 编辑器大小不起作用

html - div css高度调整

css实现{宽度:100% -150px}