html - CSS不适用于IE<8

标签 html css internet-explorer

.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>

我正在为表格单元格应用边框,但 CSS 不适用于 8 之前的 IE 版本。

最佳答案

这对我适用于 IE 6/7:

<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>

“foo”周围的表格单元格有红色边框。 http://jsfiddle.net/rUcnv/

关于html - CSS不适用于IE<8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13121766/

相关文章:

javascript - 雨量雷达在谷歌地图中的位置

html - 即使我们没有使用任何新的 css 3 属性/选择器,firefox 3 和 3.5 以及 IE 7 和 8 之间是否存在渲染差异的可能性?

JavaScript 2D 数组无法在 IE 中检索元素

html - CSS:Internet Explorer(任何版本)中的奇怪平铺错误

html - Bootstrap 页脚覆盖内容

html - 背景图片不覆盖全身

css - 为什么 'padding' 有时会算在元素宽度内,有时不会?

html - 使用图案制作响应式 Angular svg 形状

html - CSS 不能在 IE 和 Chrome 中工作,但可以通过 Chrome 在 CodePen 中工作

php - 分页的正确方法