css - 验证 (CSS 2.1) : 'behavior' is not a known CSS property name

标签 css visual-studio-2008 internet-explorer-6 behavior xhtml-1.1

我正在使用 whatever:hover模仿 IE6 中的 :hover 选择器的脚本。建议的用途是将其作为 IE6 行为附加到 body 元素。但是我的所有页面都使用 XHTML 1.1,因此当我尝试发布我的网站时,VS2008 中的 CSS 验证失败。

有什么好的方法可以解决这个问题吗?

谢谢! 康斯坦丁

相关标记:


    <!--[if IE 6]>
    <style type="text/css">
    body
    {
        behavior: url("../js/csshover3.htc");
    }
    </style>
    <![endif]-->

最佳答案

你可以放

body
    {
        behavior: url("../js/csshover3.htc");
    }

在外部 CSS 中

    <!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="ie6.css">
    <![endif]-->

编辑:

或者您可以禁用 css 错误

http://geekswithblogs.net/SoftwareDoneRight/archive/2008/03/17/quicktip-turn-off-css-validation-errors.aspx

关于css - 验证 (CSS 2.1) : 'behavior' is not a known CSS property name,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3479660/

相关文章:

css - 如何在我的 CSS 中覆盖 element.style max-width?

html - 根据具有较大宽度的兄弟元素的元素居中

css - 如何使用 Sinatra 在当前页面上突出显示导航菜单?

javascript - css position absolute 使文本框下降

c# - 使用 Compact Framework 在数据网格中设置列宽

html - 图像无法在 ie6 中呈现

c# - 如何使用 ReportViewer Local Report VS 2008 创建条形码?

visual-studio - 折叠到除区域之外的定义的快捷方式

css - Bang IE7 - 这是什么意思?

asp.net - 部署在服务器上时出现奇怪的 IE6 和 7 错误