Internet Explorer CSS hacks
测试环境: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*/
}
相关文档:
一个网站的优化有很多工作要做,其中对代码的优化是一个很关键的步骤。为了更加符合SEO的规范,下面将对目前流行的DIV+CSS的命名规则整理如下:
页头:header 登录条:loginBar
标志:logo & ......
IE6.0、IE7.0 与FireFox CSS兼容的解决方法
2009-04-29 14:51
1.DOCTYPE 影响 CSS 处理
2.FF: div 设置 margin-left, margin-right 为 auto 时已经居中, IE 不行
3.FF: body 设置 text-align 时, div 需要设置 margin: auto(主要是 margin-left,margin-right) 方可居中
4.FF: 设置 padding 后, div 会增加 height 和 ......
css满屏布局与ul和li列表 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <head>
<meta content="text/html; charset=u ......
一.文件命名规范
[b]样式文件命名[/b]
[quote]主要的 master.css
布局,版面 layout.css
专栏 columns.css
文字 font.css
打印样式 print.css
主题 themes.css [/quote]
[b]CSS ID 的命名[/b]
[quote]页头:header
登录条:loginbar
标志:logo
侧栏:sidebar
广告:banner
导航:nav
子导航:subnav
菜 ......
IE都能识别*;标准浏览器(如Firefox,Opera,Netscape)不能识别*;
IE6能识别*,但不能识别 !important,
IE7能识别*,也能识别!important;
FF不能识别*,但能识别!important;
写两句代码来控制一个属性,区别Firefox与IE6:
background:orange;*background:blue; //
这一句代码写出来时,你用firefox或其它非IE浏览时 ......