目录
介绍
针对浏览器的选择器
让IE6支持PNG透明
移除超链接的虚线
给行内元素定义宽度
让固定宽度的页面居中
图片替换技术
最小宽度
隐藏水平滚动条
一. 介绍
这篇文章包括了8个非常有用的解决办法, 在进行css设计遇到问题时你就会用到它们.
二. 针对浏览器的选择器
这些选择器在你需要针对某款浏览器进行css设计时将非常有用.
IE6及其更低版本
* html {}
IE7及其更低版本
*:first-child html {} * html {}
仅针对IE7
*:first-child html {}
IE7和当代浏览器
html>body{}
仅当代浏览器(IE7不适用)
html>/**/body{}
Opera9及其更低版本
html:first-child {}
Safari
html[xmlns*=""] body:last-child {}
要使用这些选择器,请将它们放在样式之前. 例如:
#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;}
上一页12 下一页
推荐阅读
Web标准前途是否依赖浏览器技术
原文:http://www.alistapart.com/articles/fromswitchestotargets
作者:Eric Meyer
当我读了一遍Aaron Gustafson的Beyond DOCTYPE: Web Standards, Forward Compatibility, and IE8 后,我心里的第一反应就是>>>详细阅读
本文标题:css网页设计非常有用的解决办法
地址:http://www.17bianji.com/kaifa2/CSS/17462.html
1/2 1