如何处理不同浏览器之间的样式表的兼容性问题
canca
2008-04-08 15:36
2
0
IE 不支持 "min-height" 样式
.contents { ... ...; min-height:380px; ie-only:expression(this.style.height="390px"); }
兼容 IE 和 Mozilla 的 hr 定义
hr { height: 1px; border: 0; color: silver; background-color: silver; }
IE 不支持 CSS2 中定义的 "Attribute Selectors"
input { border:dotted 1px blue; ie-only:expression( this.style.border=(this.type=="submit")?"solid 1px darkred": (this.type=="reset") ?"solid 1px darkgreen": /*else ...*/ "dotted 1px blue" ); } input[type="submit"] { border:solid 1px darkred; } input[type="reset"] { border:solid 1px darkgreen; }
att:StyleSheetCompatibilityTips.Attribute Selectors.html
在 PRE 标签中换行
http://www.w3.org/TR/css3-text/#white-space
/* Browser specific (not valid) styles to make preformatted text wrap */ pre { white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ word-wrap: break-word; /* Internet Explorer 5.5+ */ }
http://www.iki.fi/karvinen
http://users.tkk.fi/~tkarvine/linux/doc/pre-wrap/pre-wrap-css3-mozilla-opera-ie.html
发表评论