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*/
}
相关文档:
CSS定位令你可以将一个元素精确地放在页面上你所指定的地方。联合使用定位与浮动(参见第13课),你将能够创建多种高级而精确的布局。
本课我们将讨论以下内容:
CSS定位的原理
绝对定位
相对定位
CSS定位的原理
把浏览器窗口想象成一个坐标系统:
CSS定位的原理是:你可以将任何盒子(box)放置在坐标系统的任何 ......
<asp:GridView ID="GridView1" runat="server" Width="100%"
HorizontalAlign="Center" CellPadding="1" AutoGenerateColumns="False" AllowPaging="true" ......
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 和 ......
IE6实现方法:
HTML部分:
<imgsrc="..."alt="..."onload="resizeImage(this)"/>
JS部分:
<mce:scripttype="text/javascript"><!--
functionresizeImage(obj){
obj.width=obj.width>50&&obj.width>obj.height?50:auto;
obj.height=obj.height>50?50:auto;
}
// -->&l ......