Internet Explorer CSS hacks

本文介绍了如何使用不同的CSS表达方式实现特定浏览器下的样式差异,特别是针对IE浏览器的CSS Hack技巧。通过具体的例子展示了如何让IE浏览器识别特定的样式规则。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

测试环境:IE6 , IE7, IE8, FF3.0 
表达方式:表达方式: 

body { `background:red } 
body { ~background:red } 
body { !background:red } 
body { @background:red } 
body { #background:red } 
body { $background:red } 
body { %background:red } 
body { ^background:red } 
body { &background:red } 
body { *background:red } 
body { (background:red } 
body { )background:red } 
body { =background:red } 
body { +background:red } 
body { [background:red } 
body { ]background:red } 
body { {background:red } 
body { |background:red } 
body { ,background:red } 
body { <background:red } 
body { .background:red } 
body { >background:red } 
body { /background:red } 
body { ?background:red } 

结论:IE识别所有CSS Hack 结论:IE识别所有CSS Hack 

比如我们要实现在IE 中480px 的宽度,而在其他浏览器500px 的宽度,就可以通过Hack 来完成,如下:比如我们要实现在IE中480px的宽度,而在其他浏览器500px的宽度,就可以通过Hack来完成,如下: 

#hack { 
width
: 500px;
+width : 480px; /*only IE*/
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值