Html CSS不适用于IE<;8. .csstdhighlight { 左边框颜色:红色; 右边框颜色:红色; 边框底色:红色; 边框顶部颜色:红色; 边框样式:实心; 边框宽度:1px; 背景色:白色; } .csstdhighlight { 边框:1px纯红; 背景色:白色; } 福 酒吧

Html CSS不适用于IE<;8. .csstdhighlight { 左边框颜色:红色; 右边框颜色:红色; 边框底色:红色; 边框顶部颜色:红色; 边框样式:实心; 边框宽度:1px; 背景色:白色; } .csstdhighlight { 边框:1px纯红; 背景色:白色; } 福 酒吧,html,css,internet-explorer,Html,Css,Internet Explorer,我将边框应用于表格单元格,但CSS不应用于早于8的IE版本。这在IE 6/7中适用: .csstdhighlight { border-left-color: Red; border-right-color: Red; border-bottom-color: Red; border-top-color: Red; border-style: solid; border-width: 1px; background-color: White

我将边框应用于表格单元格,但CSS不应用于早于8的IE版本。

这在IE 6/7中适用:

.csstdhighlight
{
    border-left-color: Red;
    border-right-color: Red;
    border-bottom-color: Red;
    border-top-color: Red;
    border-style: solid;
    border-width: 1px;
    background-color: White;
}
<html>
<body>
<style type="text/css" media="screen">
    .csstdhighlight
    {
        border:1px solid red;
        background-color: White;
    }
</style>
<table>
    <tr>
        <td class="csstdhighlight">foo</td>
        <td>bar</td>
    </tr>
</table>
</body>
</html>

.csstdhighlight
{
边框:1px纯红;
背景色:白色;
}
福
酒吧

“foo”周围的表格单元格有一个红色边框

您的CSS没有问题,这里的问题是您的表格单元格没有内容。在IE7中,不存在空表单元格,这意味着边框样式将不会被渲染


请参阅有关空单元格的相关主题。

您知道,这可以简化为
边框:1px实心红色;背景:白色我检查您的代码背景是否适用,但边框是否适用请发布您的css应用到的html,如果可能,请创建一个显示问题的测试。看IE 6/7我刚检查了你的小提琴。它在IE7中运行良好。
<html>
<body>
<style type="text/css" media="screen">
    .csstdhighlight
    {
        border:1px solid red;
        background-color: White;
    }
</style>
<table>
    <tr>
        <td class="csstdhighlight">foo</td>
        <td>bar</td>
    </tr>
</table>
</body>
</html>