[css Hack]IE6,IE7,IE8,FireFoxµÄcssÏàÈÝÐÔ
1.Çø±ðIEºÍFirefox
.title {
background:blue; /*Firefox */
background:red \9; /*IE6¡¢IE7¡¢IE8*/
}
2.Çø±ðIE6¡¢IE7¡¢IE8¡¢Firefox
.title {
background:blue; /*Firefox */
background:red \9; /*IE6¡¢IE7¡¢IE8 */
*background:black; /*IE7 */
_background:orange; /*IE6 */
}
×¢Ò⣬ÎÞÂÛÔõÑù£¬¶¼ÊÇFireFoxÔÚ×îÇ°£¬ie°æ±¾ÒÀ´Î½µµÍ£¬
ÒòΪºóÃæµÄcss¿ÉÒÔ¸²¸ÇÇ°ÃæµÄ¡£
Ïà¹ØÎĵµ£º
When you meet trouble with css style in IE7, try this. You can set different css for IE7 and the other browsers.
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="/home_c_ie7.css" mce_href="home_c_ie7.css" />
<![endif]-->
......
½ñÌìдÁËÒ»¸ö¼òµ¥µÄÍøÒ³£¬Çë¿´´úÂ룺
´íÎóµÄ£º
HTML´úÂ룺
½ñÌìµÄÈÕ×Ó
//CSS´úÂëʹÓÃÍⲿÒýÈëʽ
ÎҵļÒÏçÔÚ¿Àï
CSS´úÂ룺
/* CSS Document */
body{
font-family:Arial, Helvetica, sans-serif;
font-size:20px;
color:red; /*ÒªµÄ¾ÍÊÇÕâÑùµÄЧ¹û£ºÉèÖÃ×ÖÌåÑÕɫΪºìÉ«*/
}
½á¹ûÏÔʾµÄ×ÖÌ ......
<!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 http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>ÎҵĻ¬¶¯ÃÅ& ......