ÍæתCSS£¬´Ó²ËÄñ¿ªÊ¼Ö® CSS×ÖÌåÑÕÉ«µÄÉèÖÃ
½ñÌìдÁËÒ»¸ö¼òµ¥µÄÍøÒ³£¬Çë¿´´úÂ룺
´íÎóµÄ£º
HTML´úÂ룺
½ñÌìµÄÈÕ×Ó
//CSS´úÂëʹÓÃÍⲿÒýÈëʽ
ÎҵļÒÏçÔÚ¿Àï
CSS´úÂ룺
/* CSS Document */
body{
font-family:Arial, Helvetica, sans-serif;
font-size:20px;
color:red; /*ÒªµÄ¾ÍÊÇÕâÑùµÄЧ¹û£ºÉèÖÃ×ÖÌåÑÕɫΪºìÉ«*/
}
½á¹ûÏÔʾµÄ×ÖÌ壺ÑÕÉ«Îޱ仯
Õý½â£º
½ñÌìдÁËÒ»¸ö¼òµ¥µÄÍøÒ³£¬Çë¿´´úÂ룺
´íÎóµÄ£º
HTML´úÂ룺
½ñÌìµÄÈÕ×Ó
//CSS´úÂëʹÓÃÍⲿÒýÈëʽ
ÎҵļÒÏçÔÚ¿Àï
CSS´úÂ룺
/* CSS Document */
body{
font-family:Arial, Helvetica, sans-serif;
font-size:20px;
color:red; /*ÒªµÄ¾ÍÊÇÕâÑùµÄЧ¹û£ºÉèÖÃ×ÖÌåÑÕɫΪºìÉ«*/
}
½á¹ûÏÔʾµÄ×ÖÌ壺ÑÕÉ«ºìÉ«£¬
½áÂÛ£º
relÊÇRelationsµÄËõд Ö¸¹ØÁªµ½Ò»¸östylesheet£¨Ñùʽ±íµ¥)
ÔÚ±êÇ©ÖУ¬¡°rel=stylesheet¡±£¬relÊǹØÁªµÄÒâ˼£¬¹ØÁªµÄÊÇÒ»¸öÑùʽ±í(stylesheet)Îĵµ£¬Ëü±íʾÕâ¸ölinkÔÚÎĵµ³õʼ»¯Ê±½«±»Ê¹Óá£Ò»°ãÕâÀïÊDz»ÐèÒª¸Ä¶¯µÄ
Ïà¹ØÎĵµ£º
css²¼¾ÖµÄʱºò¶à¶à×¢Òâһϣ¬ÏàÐźܿì¾Í¿ÉÒÔÕÆÎÕÁËcss²¼¾ÖµÄ¼¼ÇÉ£¡
Ò»¡¢IE±ß¿òÈôÏÔÈôÎÞ£¬Ðë×¢Ò⣬¶¨ÊǸ߶ÈÉèÖÃÒÑÍü¼Ç£»
¶þ¡¢¸¡¶¯²úÉúÓÐÔµ¹Ê£¬ÈôÒª¸¸²ã°üº¬×¡£¬½ô¸ú¸¡¶¯ÒªÇå³ý£¬ÈÝÆ÷×ÔÈ»ÏÔÆäÖУ»
Èý¡¢ÈýÏñËØÎı¾ÂýÒƲ»±Ø»Å£¬¸ß¶ÈÉèÖðïÄã棻
ËÄ¡¢¼æÈݸ÷¸öä¯ÀÀÐë×¢Ò⣬ĬÈÏÉèÖÃÐи߿ÉÄÜÊÇɱÊÖ£»
Îå¡¢¶ÀÁ¢Çå³ý¸¡¶¯ÐëÃú¼Ç ......
IE6¡¢IE7¡¢IE8¡¢FFä¯ÀÀÆ÷µÄCSS¼æÈÝÎÊÌ⣬±¾À´ie6¸úffÖ®¼äµÄ¼æÈÝÊǺÜÈÝÒ×½â¾öµÄ¡£¼ÓÉϸöie7»áÂé·³µã£¬ie8µÄ³öÏ־͸üÍ·ÌÛÁË£¬ÔÀ´hack ie7µÄ·½·¨ÓÖ²»ÄÜÓÃÁË£¬Ôõô°ìÄØ£¿
»¹ºÃ£¬Î¢ÈíÌṩÁËÕâÑùÒ»¸ö´úÂ룺 °ÑÕâ¶Î´úÂë·Åµ½ÀïÃ棬ÔÚie8ÀïÃæµÄÒ³Ãæ½âÎöÆðÀ´¾Í¸úie7һģһÑùµÄÁË£¬ËùÒÔ£¬»ù±¾ÉÏ¿ÉÒÔÎÞÊÓie8£¬Ê£ÏµĴúÂëÖ»ÐèÒªÕâÑùд¾ ......
-----------------------------------------------
Á´½ÓÍâÃæÎļþcss
<link href="layout.css" rel="stylesheet" type="text/css" />
-----------------------------------------------
дÎı¾ : <div id="mainContent">
<p>1Áй̶¨¿í¶È¾ÓÖÐ+Í·²¿+µ¼º½+β²¿—&mdash ......
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]-->
......