Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÉÆÓÃcssËõд¹æÔò

Ò»¡¢  ÉÆÓÃcssËõд¹æÔò
/*×¢ÒâÉÏ¡¢ÓÒ¡¢Ï¡¢×óµÄÊéд˳Ðò*/
1.      ¹ØÓڱ߾ࣨ4±ß£©£º
1px 2px 3px 4px (ÉÏ¡¢ÓÒ¡¢Ï¡¢×ó)
1px 2px 3px    £¨Ê¡ÂÔµÄ×óµÈÓÚÓÒ£©
1px 2px        (Ê¡ÂÔµÄÉϵÈÓÚÏÂ)
1px            £¨Ëı߶¼Ïàͬ£©
2.      ¼ò»¯ËùÓУº
*/ body{margin:0}------------±íʾÍøÒ³ÄÚËùÓÐÔªËصÄmarginΪ0
#menu{ margin:0}------------±íʾmenuºÐ×ÓϵÄËùÓÐÔªËصÄmarginΪ0
3.      Ëõд£¨border£©Ìض¨Ñùʽ£º
Border:1px solid #ffffff;
Border-width:0 1px 2px 3px;
4.      ¹ØÓÚÎÄ×ÖµÄËõд¹æÔò£º
Font-style:italic;  бÌåÐÎʽ
Font-variant:small-caps/normal;  ±äÌåÑùʽ£ºÐ¡ÐÍ´óд×Öĸ/Õý³£
Font-weight:bold;
Font-size:12px;
Line-height:1.2em(120%)/1.5em(150%);
Font-family:arrial,sans-serif,verdana;
Ëõд³É£º
Font:italic small-caps bold 12px/1.5em arrial,sans-serif;
×¢Ò⣺Font-sizeºÍLine-heightÓÃб¸Ü×éºÏÔÚÒ»Æð²»ÄÜ·Ö¿ªÐ´¡£
5.      ¹ØÓÚ±³¾°Í¼Æ¬µÄ£º
Background:#FFF url(log.gif) no-repeat fixed top left;
6.      ¹ØÓÚÁÐ±í£º
List-style-type:square/none;
List-style-position:inside;
List-style-image:url(filename.gif);
Ëõд³É£º
List-style:none inside url(filename.gif)
¶þ¡¢ ÔËÓÃ4ÖÖ·½·¨À´ÒýÈëCSSÑùʽ
    1.link
<link rel=¡±stylesheet¡± type=¡±text/css¡± href=¡±a.css¡±>
rel ¹Øϵ
type Êý¾ÝÀàÐÍ,ÓжàÖÖ
href ·¾¶
²¿·Öä¯ÀÀÆ÷Ö§³ÖºòÑ¡Ñùʽ,¹Ø¼ü×Ö:alternate:
<link rel=¡±stylesheet¡± type=¡±text/css¡± href=¡±a.css¡±>
<link rel=¡±alternate stylesheet¡± type=¡±text/css¡± href=¡±b.css¡±>
<link rel=¡±alternate stylesheet¡± type=¡±text/css¡± href=¡±c.css¡±>
2.ÄÚ²¿Ñùʽ¿é
<style>
<!–
h1{color:red;}


Ïà¹ØÎĵµ£º

³ÉΪһÁ÷CSSÉè¼ÆʦµÄ8´ó¼¼ÇÉ

CSSÊÇÒ»¸ö·Ç³£Ç¿´óµÄÍøÕ¾Éè¼Æ±ê¼ÇÓïÑÔ¡£
¡¡¡¡
¡¡¡¡ËäÈ»Äã¿ÉÄÜ»áÈÏΪ£¬ÈκÎÈ˶¼¿ÉÒÔתȥдCSS´úÂ룬µ«ÊÇΪÁËÈ·±£ÄúÔÚÕýÈ·µÄ¹ìµÀÉÏ£¬ÕâÀïÓÐÈçÏÂ8Ïî
CSSÔ­Ôò£¬Ã¿¸öÍøÒ³Éè¼ÆʦӦ¸Ã×ñÑ­¡£
¡¡¡¡
¡¡¡¡1¡¢W3CÑéÖ¤
¡¡¡¡
¡¡¡¡Èç¹ûÄãÊÇ1¸öÕýÔÚдCSS±àÂëµÄÈËÔ±£¬ÄÇô½¨ÒéÄúÿ´Î¶ÔÄúËù´´½¨µÄCSS´úÂë½øÐÐÑéÖ¤¡£µ«ÊÇ£¬ÓкܶàÉè
¼ÆÊ ......

µãµãµÎµÎ(CSS)

CSS important
    .dialog{margin:4px !important;margin:1px;} /* IEÒÔ×îºó³öÏÖµÄΪ׼, Firefox|Opera|SafariÒÔ!importantΪ׼ */
CSS DIV°ë͸Ã÷
    filter: alpha(opacity=50); /*IEÖ§³Ö(·¶Î§0-100)*/
    opacity: 0.50; /*·ÇIEÖ§³Ö(·¶Î§0-1)*/
    ......

8¸ö²»¼æÈÝIE 8µÄCSSÑùʽд·¨


Internet Explorer 8Ô¤ÉèÊÇÒÔCSS 2.1Ϊ±ê×¼£¬²¢ÐÞÕýÁËÐí¶àInternet Explorer 7µÄCSS Bug£¬ÕâÒâζ×ÅÓÐÒ»²¿·ÝÒÔÍùÒÀ¾ÝIE 7ËùÉè¼ÆµÄÍøÒ³£¬
ÔÚIE 8ÉϵijÊÏÖ»áÓÐËù³öÈ룬ËùÐÒ°ÝIE 7ÏàÈݼìÊÓ¹¦ÄÜËù´Í£¬Ä¿Ç°ÒòʹÓÃIE 8¶øµ¼Ö°æÃæ´íÎóµÄÍøÕ¾²¢²»¶à¡£
µ«Ò»ÖµÒÀÀµIE 7ÏàÈݼìÊÓ¹¦Äܲ¢·Ç³¤¾ÃÖ®¼Æ£¬¾¡Ô罫ÍøÕ¾ÐÞ¸ÄΪIE 8ÏàÈݲÅÊdz¤¾Ã ......

css×Ô¶¯»»ÐÐ,·ÀÖ¹³ÅÆÆdiv

¶¯»»ÐÐÎÊÌâ,Õý³£×Ö·ûµÄ»»ÐÐÊDZȽϺÏÀíµÄ,¶øÁ¬ÐøµÄÊý×ÖºÍÓ¢ÎÄ×Ö·û³£³£½«ÈÝÆ÷³Å´ó,ͦÈÃÈËÍ·ÌÛ,ÏÂÃæ½éÉܵÄÊÇCSSÈçºÎʵÏÖ»»Ðеķ½·¨
¶ÔÓÚdiv,pµÈ¿é¼¶ÔªËØ
Õý³£ÎÄ×ֵĻ»ÐÐ(ÑÇÖÞÎÄ×ֺͷÇÑÇÖÞÎÄ×Ö)ÔªËØÓµÓÐĬÈϵÄwhite-space:normal,µ±¶¨ÒåµÄ¿í¶ÈÖ®ºó×Ô¶¯»»ÐÐ
html
<
id="wrap">Õý³£ÎÄ×ֵĻ»ÐÐ(ÑÇÖÞÎÄ×ֺͷÇÑÇÖÞÎÄ×Ö) ......

CSS²¼¾Ö ¿é¼¶ÔªËؼ°ÄÚÁªÔªËØ

Block element ¿é¼¶ÔªËØ
¹ËÃû˼Òå¾ÍÊÇÒÔ¿éÏÔʾµÄÔªËØ£¬¸ß¶È¿í¶È¶¼ÊÇ¿ÉÒÔÉèÖõġ£±ÈÈçÎÒÃdz£ÓõÄ<div>¡¢<p>¡¢<ul>ĬÈÏ״̬϶¼ÊÇÊôÓڿ鼶ԪËØ¡£¿é¼¶ÔªËرȽϰԵÀ£¬Ä¬ÈÏ״̬ÏÂÿ´Î¶¼Õ¼¾ÝÒ»Õû¸öÐУ¬ºóÃæµÄÄÚÈÝÒ²±ØÐëÔÙÐÂÆðÒ»ÐÐÏÔʾ¡£µ±È»·Ç¿é¼¶ÔªËØÒ²¿ÉÒÔͨ¹ýcssµÄdisplay:block;½«Æä¸ü¸Ä³É¿é¼¶ÔªËØ¡£´ËÍâ» ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ