关于css伪类的一些兼容性测试

测试环境:xp ,ie7~8  chrome。

link 伪类 :(:link,:visited)  这个是链接专用

动态伪类 :(:hover,:active,:focus)

<!DOCTYPE html>
<html>
<head></head>
<style type="text/css">
a:link,input:hover{color:blue;}
a:visited{color:green;}
a:active{color:red;}
a:hover{color:yellow;}
tr:hover,p:hover{background-color:red;}
input:focus,p:focus{background-color:yellow;}
</style>
<body>
<input type="text" />
<a href="http://www.baidu.com">百度</a>
<a href="http://www.google.com">google</a>
<div>test</div>
<table><tr><td>test</td></tr></table>
<p>zhe ye shi test</p>
<input type="checkbox">nan
</body>
</html>

对于链接(a标记)不管是link伪类还是动态伪类,在ie7-8,chrome 都有效果

对于表单元素,ie7 下不支持动态伪类,

                       ie8下文本框,单选框都支持:focus,

                       chrome下文本框支持:focus,复选框不支持focus

对于p,tr ,ie7-8,chrome 都只支持:hover。

只是简单测试,欢迎指正

更希望能有朋友提供学习资源


关于css伪类的一些兼容性测试,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。