_property:value属性前加_线,该hack对IE有效,在FF下无效这段代码在IE下看,div的边框为蓝色,而在FireFox下无效 <!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> <title> new document </title> <meta name=”generator” content=”editplus” /> <meta name=”author” content=”” /> <meta name=”keywords” content=”” /> <meta name=”description” content=”” /> <style type=”text/css”> div { _border:solid 1px blue; width:300px; height:300px; } </style> </head> <body> <div>yibin.us</div> </body> </html> 运行代码 盒模型解决方法选择符 {width:IE5.x宽度; voice-family :”\”}\””; voice-family:inherit; width:正确宽度;}IE5.5及以下版本不认,其它版本与FF都认如下,该段代码在FF与IE6/IE7能正确显示div宽度为200px [...]
Browsing the archives for the css tag
!important;严格来说,!important;应该不能算作是一种hack技术,被应用了!important;的属性将在IE中无效,对FF有效。如以下这段,在FF中div1的背景将是红色,而在IE中却是蓝色 <!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> <title> new document </title> <meta name=”generator” content=”editplus” /> <meta name=”author” content=”” /> <meta name=”keywords” content=”” /> <meta name=”description” content=”” /> <style type=”text/css”> #div1 { background:red !important; background:blue; } </style> </head> <body> <div id=”div1″>div1</div> </body> </html> 运行代码 * html 选择符 {…}IE6及以下版本识别,对FF无效 <!DOCTYPE html PUBLIC [...]
position:fixed在ie6及以下版本下不大好用firefox运行: <!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> <title> new document </title> <meta name=”generator” content=”editplus” /> <meta name=”author” content=”” /> <meta name=”keywords” content=”” /> <meta name=”description” content=”” /> <style type=”text/css”> p { height:100px; } </style> </head> <body> <p></p> <p></p> <p></p> <p></p> <p></p> <p></p> <p></p> <p></p> <p></p> <p></p> <p></p> <p></p> <p></p> <div [...]