【发布时间】:2012-08-27 07:19:44
【问题描述】:
这是我的 CSS 代码;
#wrap {
width:50em;
max-width: 94%;
margin: 0 auto;
background-color:#fff;
}
#head {
width:50em;
height:10em;
max-width: 100%;
margin: 0 auto;
text-align:center;
position: relative;
}
#css-table {
display: table;
margin: 1em auto;
position: relative;
width:50em;
max-width: 100%;
}
#css-table .col {
display: table-cell;
width: 20em;
padding: 0px;
margin: 0 auto;
}
#css-table .col:nth-child(even) {
background: #fff;
}
#css-table .col:nth-child(odd) {
background: #fff;
border-right: 4px double #b5b5b5;
}
还有我的 HTML 代码;
<div id="cont">
<div id="css-table">
<div class="col">123</div>
<div class="col">123</div>
</div>
</div>
当我缩放 Firefox 窗口时,表格可以很好地缩放到 300 像素宽度的视口……就像我想要的那样。但是在 Chrome 中,只有当视口宽于 50em 时,表格才显得正常。如果我缩小 Chrome 窗口,表格的右侧会溢出。
Chrome 这样做有什么原因吗?
【问题讨论】:
标签: css google-chrome firefox css-tables