目录
一. 介绍
这篇文章包括了8个非常有用的解决办法, 在进行css设计遇到问题时你就会用到它们. Webjx.Com
二. 针对浏览器的选择器 Webjx.Com
这些选择器在你需要针对某款浏览器进行css设计时将非常有用.
Webjx.Com
IE6及其更低版本
* html {}
IE7及其更低版本
*:first-child+html {} * html {}
仅针对IE7 Webjx.Com
*:first-child+html {}
IE7和当代浏览器 Webjx.Com
html>body{}
仅当代浏览器(IE7不适用)
html>/**/body{}
Opera9及其更低版本
html:first-child {}
Safari Webjx.Com
html[xmlns*=""] body:last-child {} Webjx.Com
要使用这些选择器,请将它们放在样式之前. 例如:
#content-box {width: 300px;height: 150px;}* html#content-box {width: 250px;} /* overrides the above style and changes the width to 250px in IE 6 and below */ 网页教学网
三. 让IE6支持PNG透明 网页教学网
一个IE6的Bug引起了大麻烦, 他不支持透明的PNG图片.
你需要使用一个css滤镜
*html #image-style {background-image: none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="filename.png", sizingMethod="scale");}
四. 移除超链接的虚线(仅对FF有效) 网页教学网
FireFox下,当你点击一个超链接时会在外围出现一个虚线轮廓. 这很容易解决, 只需要在标签样式中加入 outline:none .
a{outline: none;}
网页教学网