【问题标题】:Nested table-row not not filling 100% in IE嵌套表行未在 IE 中填充 100%
【发布时间】:2013-08-29 09:37:14
【问题描述】:

我正在使用 display: table-row 处理相当复杂的布局,而在 IE 中,当我使用嵌套表格时,我无法拉伸行。

在 Chrome/FF 与 IE(10) 中的 http://jsfiddle.net/DVxpZ/7/ 中查看此内容

我希望蓝色行拉伸以填充可用空间,紫色行位于底部。

感谢您的任何建议。我尝试使用位置:固定;对于这种布局,但随着屏幕尺寸变小,我无法调整行的大小。

<div id="full-height" class="table">
    <header class="table-row"><div class="button"></div></header>
    <div id="main"class="table-row">
        <div class="table">
            <div id="row1" class="table-row"><div class="button"></div></div> 
            <div id="row2" class="table-row"><div class="button"></div></div> 
            <div id="row3" class="table-row"><div class="button"></div></div> 
            <div id="row4" class="table-row stretch-row"><div class="button"></div></div> 
            <div id="row5" class="table-row"><div class="button"></div></div> 
        </div>
    </div>
</div>

还有CSS

body, html{
    height: 100%;
    width: 100%;
    overflow: hidden;
    overflow-y: auto;
}
.table-cell{
    display: table-cell;
}
.full-cell{
    height: 100%;
    width: 100%;
}
#main{
    height: 100%;
}

.button{
    display: block;
    height: 30px;
    width: 100px;
    background-color: green;
    margin: 3px;
}

#row1{
    background-color: pink;
}

#row2{
    background-color: orange;
}

#row3{
    background-color: red;
}

#row4{
    background-color: blue;
}


#row5{
    background-color: purple;
}


#full-height{ 
    height:100%;
    width: 100%;
}

.table{
    display: table;
    height: 100%;
    width: 100%;
    background: yellow;
}

.table-row {
    display: table-row;
}

.stretch-row{
    height: 100%;
}

【问题讨论】:

    标签: html css internet-explorer css-tables


    【解决方案1】:
    *{
        margin:0;
        padding:0;
    }
    

    尝试重置所有元素边距??

    http://jsfiddle.net/DVxpZ/9/

    【讨论】:

      猜你喜欢
      • 2013-03-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-06
      • 1970-01-01
      相关资源
      最近更新 更多