针对firefox ie6 ie7的css样式
技术   October 16, 2006   引用(0)   
引用
现在我大部分都是用!important来hack,对于ie6和firefox测试可以正常显示,但是ie7对!important可以正确解释,会导致页面没按要求显示!搜索了一下,找到一个针对IE7不错的hack方式就是使用“*+html”,现在用IE7浏览一下,应该没有问题了。

现在写一个CSS可以这样:
#example { color: #333; } /* Moz */
* html #example { color: #666; } /* IE6 */
*+html #example { color: #999; } /* IE7 */

那么在firefox下字体颜色显示为#333,IE6下字体颜色显示为#666,IE7下字体颜色显示为#999,他们都互不干扰。
This entry comes from 本站原创 and has been read for 6283 times. It is tagged with .
烟雨江南 Homepage says: at October 23, 2006 19:54
请教一下,这三行代码具体应该怎么添加?是添加到elements还是styles里?我放在elements的头三行,结果虽然实现了兼容的功能,但是网页上方也会显示出这些代码。
pfire 回复于 October 23, 2006 22:12
什么代码?有没有具体演示?
幻轩 Homepage says: at October 17, 2006 13:49
zan找到好东西了~
pfire 回复于 October 19, 2006 16:57
作风格要考虑的越来越多了
分页: 1/1 第一页 1 最后页
发表评论

昵称

网址

电邮

OpenID登入 高级选项 表情