gpt4 book ai didi

html - CSS 在 IE 中显示表格

转载 作者:搜寻专家 更新时间:2023-10-31 22:32:25 25 4
gpt4 key购买 nike

我有以下代码和 CSS。它在 Chrome 中运行良好,但在 IE 中运行良好。有什么方法可以让它在 IE 中工作吗?

CSS:

<style type="text/css">
.table {width:100%;height: 1%;background-color: lime;display: table;border-collapse: collapse;}
.row {display: table-row;}
.centercell {vertical-align: top;display: table-cell;background-color: #0f0;}
.top{background-color:yellow;width:100%;height:20px;z-index: 1;position: relative;}
.bottom{background-color:yellow;width:100%;height:20px;z-index: 1;position: relative;}
.middle{background-color:pink;width:100%;height: 100%;margin: -20px 0px;position: relative;padding: 20px 0px;}
.rightcell {vertical-align: top;background-color: #f00;display: table-cell;width:155px;background-image: url('img/bg1.gif');background-repeat:repeat-y}
.leftcell {vertical-align: top;background-color: #f00;display: table-cell;width:171px;}
</style>

HTML:

<div class="table">
<div class="row">
<div class="leftcell">
right column
</div>
<div class="centercell">
<div class="top">center top</div>
<div class="middle">center middle</div>
<div class="bottom">center bottom</div>
</div>
<div class="rightcell">
right column<br>
right column<br>
right column<br>
right column<br>
right column<br>
right column<br>
right column<br>
right column<br>
</div>
</div>

最佳答案

IE7 不支持display:table ,您的代码在 IE8、IE9 和 IE10 中看起来不错。所以要么你必须使用实际的 <table>或者,如果可以的话,使用 float s 代替。

恐怕没有别的办法。

编辑:显然这是针对您的页面布局。你不应该使用 <table>display:table .只是 float 一些 DIV 伙计!

关于html - CSS 在 IE 中显示表格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13384619/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com