我知道 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/