css在 IE8下的兼容性(常用伪类、超链接图片蓝框,图片间隙)


常用伪类选择器

 

  IE7 IE8 IE9
:hover
:focus ×
:first-child
:last-child × ×
:first-of-type × ×
:last-of-type × ×
:nth-child(n) × ×
:nth-last-child(n) × ×
:nth-of-type(n) × ×
:nth-last-of-type(n) × ×
:enabled × ×
:disabled × ×
:checked × ×

 

 兼容写法:

选中第三个p标签: 

div p:first-child+p+p{...}

以此类推,以上所有伪类都可以兼容到。

优先级:伪类选择器>class选择器

1. 超链接图片有蓝框

a{
border:none;
}

2. 图片间隙

img{
display:block;
}

3. 图片或元素聚焦后的虚线框

img{
outline:none;
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM