我正在使用 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 错误
关于css - 验证 (CSS 2.1) : 'behavior' is not a known CSS property name,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3479660/