html - 如何在单行(IE6-IE7)上显示表格单元格?

标签 html css

我知道 IE6-IE7 中单元格显示的兼容性问题,我的目标是在同一行显示两个 div 显示单元格。在除 IE6-IE7 之外的所有浏览器上,这两个 div 显示在同一行上。不过我注意到一件事,将怪癖模式 * float: left to the first div, divs are shown on the same line。如何在不使用仅 css 的 quircks 模式的情况下将它们放在同一行?

最佳答案

使用这个 CSS:

body{
    margin: 0
}
#table{
    display: table;
    width: 100%;
    height: 50px;
    *overflow:auto;
}
#r1{
    display: table-cell;
    width: 30px;
    background-color: black;
    *float:left;

}
#r2{
    display: table-cell;
    width: 30px;
    background-color: #eee;
    *float:left;
}

关于html - 如何在单行(IE6-IE7)上显示表格单元格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18317306/

相关文章:

javascript - 如何在 Javascript/PHP 中选择月份和年份后立即填充月份的天数?

c# - 需要 CSS 方面的帮助

javascript - 如何更改按钮内的文本?

CSS 转换不适用于内联元素

css - 如何使包含 div 中的这三个 div 在 chrome 中正确 float - 第三个 div 低于前两个

css - 为什么使用 p :nth-child(3n+0) css pseudo class starts with the 2nd element?

javascript - 如何将文档内容动态加载到 iframe 中?

html - CSS 内部区域

jquery - 在表中添加滚动到除第一列以外的所有列

javascript - 淡入并向下移动