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

cssÖ®×Ô¶¯»»ÐÐ

×Ô¶¯»»ÐÐÎÊÌâ,Õý³£×Ö·ûµÄ»»ÐÐÊDZȽϺÏÀíµÄ,¶øÁ¬ÐøµÄÊý×ÖºÍÓ¢ÎÄ×Ö·û³£³£½«ÈÝÆ÷³Å´ó,ͦÈÃÈËÍ·ÌÛ,ÏÂÃæ½éÉܵÄÊÇCSSÈçºÎʵÏÖ»»Ðеķ½·¨
¶ÔÓÚdiv,pµÈ¿é¼¶ÔªËØ
Õý³£ÎÄ×ֵĻ»ÐÐ(ÑÇÖÞÎÄ×ֺͷÇÑÇÖÞÎÄ×Ö)ÔªËØÓµÓÐĬÈϵÄwhite-space:normal,µ±¶¨ÒåµÄ¿í¶ÈÖ®ºó×Ô¶¯»»ÐÐ
html
css
1.£¨IEä¯ÀÀÆ÷£©Á¬ÐøµÄÓ¢ÎÄ×Ö·ûºÍ°¢À­²®Êý×Ö,ʹÓÃword-wrap : break-word ;»òÕßword-break:break-all;ʵÏÖÇ¿ÖƶÏÐÐ
»òÕß
Ч¹û£º¿ÉÒÔʵÏÖ»»ÐÐ
2.£¨Firefoxä¯ÀÀÆ÷£©Á¬ÐøµÄÓ¢ÎÄ×Ö·ûºÍ°¢À­²®Êý×ֵĶÏÐÐ,FirefoxµÄËùÓа汾µÄûÓнâ¾öÕâ¸öÎÊÌâ,ÎÒÃÇÖ»ÓÐÈó¬³ö±ß½çµÄ×Ö·ûÒþ²Ø»òÕß,¸øÈÝÆ÷Ìí¼Ó¹ö¶¯Ìõ
Ч¹û£ºÈÝÆ÷Õý³££¬ÄÚÈÝÒþ²Ø
¶ÔÓÚtable
1. (IEä¯ÀÀÆ÷)ʹÓà table-layout:fixed;Ç¿ÖÆtableµÄ¿í¶È,¶àÓàÄÚÈÝÒþ²Ø
<tr>
<td>abcdefghigklmnopqrstuvwxyz1234567890ssssssssssssss
</td>
</tr>
</table>
Ч¹û£ºÒþ²Ø¶àÓàÄÚÈÝ
2.(IEä¯ÀÀÆ÷)ʹÓà table-layout:fixed;Ç¿ÖÆtableµÄ¿í¶È,ÄÚ²ãtd,th²ÉÓÃword-break : break-all;»òÕßword-wrap : break-word ;»»ÐÐ
<tr>
<td width="25%" style="word-break : break-all; ">abcdefghigklmnopqrstuvwxyz 1234567890
</td>
<td style="word-wrap : break-word ;">abcdefghigklmnopqrstuvwxyz 1234567890
</td>
</tr>
</table>
Ч¹û£º¿ÉÒÔ»»ÐÐ
3. (IEä¯ÀÀÆ÷)ÔÚtd,thÖÐǶÌ×div,pµÈ²ÉÓÃÉÏÃæÌáµ½µÄdiv,pµÄ»»Ðз½·¨
4.(Firefoxä¯ÀÀÆ÷)ʹÓà table-layout:fixed;Ç¿ÖÆtableµÄ¿í¶È,ÄÚ²ãtd,th²ÉÓÃword-break : break-all;»òÕßword-wrap : break-word ;»»ÐУ¬Ê¹ÓÃoverflow:hidden;Òþ²Ø³¬³öÄÚÈÝ£¬ÕâÀïoverflow:auto;ÎÞ·¨Æð×÷ÓÃ
<tr>
<td width="25%" style="word-break : break-all; overflow:hidden; ">abcdefghigklmnopqrstuvwxyz1234567890</td>
<td width="75%" style="word-wrap : break-word; overflow:hidden; ">abcdefghigklmnopqrstuvwxyz1234567890</td>
</tr>
</table>
Ч¹û£ºÒþ²Ø¶àÓÚÄÚÈÝ
5.(Firefoxä¯ÀÀÆ÷) ÔÚtd,thÖÐǶÌ×div,pµÈ²ÉÓÃÉÏÃæÌáµ½µÄ¶Ô¸¶FirefoxµÄ·½·¨
ÔËÐдúÂë¿ò
×îºó£¬ÕâÖÖÏÖÏó³öÏֵļ¸ÂʺÜС£¬µ«ÊDz»ÄÜÅųýÍøÓѵĶñ¸ã¡£Èç¹ûÓÐʲôÎÊÌâÇëµ½ÎÒµÄÁôÑÔ±¾Ìá³ö
ÏÂÃæÊÇÌáµ½µÄÀý×ÓµÄЧ¹û
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/D


Ïà¹ØÎĵµ£º

cssѧϰ×ܽá

Ò» ¹ØÓÚcssµÄidÑ¡Ôñ·û
      ÿ¸öhtmlµÄÔªËض¼°üº¬Ò»¸öidÊôÐÔ£¬¸ÃÊôÐÔÊÇΨһµÄ£¬¿ÉÒÔΨһ±êʾһ¸öÔªËØ£¬ÎÒÃǾͿÉÒÔÑ¡Ôñ¸ü¾ßÌåµÄÔªËØ¡£isÊôÐÔÓɾ®ºÅ¼Óid×é³É¡£
p#bulletinContent
{
  color:Yellow ;
  background-color:Maroon ;  
}
  html½çÃæÈçÏ£º
 &l ......

CSSÉè¼Æ½Ì³Ì Àý1£­1 ±³¾°Í¼Æ¬

´Ó½ñÌ쿪ʼ£¬CSSÉè¼Æ½Ì³ÌºÍ´ó¼Ò¼ûÃæÁË¡£Ã¿ÌìÒ»½Ú£¬ÓÐѧϰµÄͬѧÇëÿÌì¹Ø×¢ÎÒÃÇÍøÕ¾¡£
Àý1£­1 ±³¾°Í¼Æ¬
µÚÒ»¸öÀý×ÓչʾÁ˶ÔbackgroundÊôÐÔµÄÔËÓ㬱¾Àý×Ó°ÑbackgroundÊôÐÔÓëÒ»¸ödivÔªËØÏà½áºÏ¡£divµÄ´óСΪ250pxX76px£¬ËùÒÔËü»áÏÔʾ³öÒ»¸öÍêÕûµÄ±³¾°Í¼Æ¬¡£
ÒÔÏÂÊDZ¾ÊµÀýµÄÏêϸ³ÌÐò£¬µ÷ÊÔÔÚMicrosoft Visual Studio 2010°æ ......

CSS hack£ºÇø·ÖIE6¡¢IE7¡¢IE8¡¢Firefox¡¢Opera

·½·¨Ò»£º
  ¿çä¯ÀÀÆ÷µÄÍøÒ³Éè¼ÆÒ»Ö±ÊÇÈÃÈ˺ÜÍ·ÌÛµÄÎÊÌ⣬Õâ²»Ö»ÊÇÒòΪä¯ÀÀÆ÷µÄ°æ±¾Öڶ࣬»¹ÓÐÒ»¸öÖØÒªµÄÔ­ÒòÊÇÏàͬä¯ÀÀÆ÷µÄ²»Í¬Ê±Æڵİ汾Ҳ»áÓвîÒ죬
ÉõÖÁÊÇÔÚ²»Í¬²Ù×÷̨ͬÉÏ»¹»áÓв»Í¬¡£Òò´ËʹCSS hack¼¼Êõ½øÐÐä¯ÀÀÆ÷Çø·ÖÊÇʵÏÖ¿çä¯ÀÀÆ÷·ÃÎÊÒ»¸öºÃ·½·¨¡£CSS
Hack¼¼ÊõÓкܶ࣬¾ßÌå¿ÉÒԲ鿴£º
  ± ......

cssÖÐ idºÍclassÇø±ðÓëʹÓÃ

idºÍclassµ½µ×ÒªÓÃÄÄÒ»¸ö£¿
¡¡¡¡Ê×ÏÈÒªÃ÷°×idºÍclassµÄ¸÷×ÔµÄÓÅȱµã¡£ÕâÑù²ÅÄܸù¾ÝËûÃǵĸ÷×ÔµÄÌصã½øÐÐʹÓá£
¡¡¡¡idµÄÓŵ㣨classµÄȱµã£©£ºidдÔÚcssÓÃ"#"Ñ¡ÔñÆ÷£¬classдÔÚcssÖÐÓÃ"."Ñ¡ÔñÆ÷¡£"#"Ñ¡ÔñÆ÷µÄÓÅÏȼ¶¸ßÓÚ"."Ñ¡ÔñÆ÷´óÔ¼10±¶£¬ËùÒÔµ±ÄãÐèÒªÌáÉýÓÅÏȼ¶µÄʱºò£¬id±êÇ©£¬»òÕßidÈÝÆ÷ÄڵıêÇ©½«ÊǺÜÈÝÒ׺ÍÓÐЧµÄ¡£ ......

CSS ±»ºöÂԵij£Ê¶

CSS ±»ºöÂԵij£Ê¶
ÎÄÕ·ÖÀà:WebÇ°¶Ë
1¡¢²»ÒªÊ¹ÓùýСµÄͼƬ×ö±³¾°Æ½ÆÌ¡£Õâ¾ÍÊÇΪºÎºÜ¶àÈ˶¼²»Óà 1px µÄÔ­Òò£¬Õâ²ÅÖªÏþ¡£¿í¸ß 1px µÄͼƬƽÆ̳öÒ»¸ö¿í¸ß 200px µÄÇøÓò£¬ÐèÒª 200*200=40, 000 ´Î£¬Õ¼ÓÃ×ÊÔ´¡£
2¡¢Îޱ߿ò¡£ÍƼöµÄд·¨ÊÇ border:none;£¬¹þ¹þ£¬ÎÒÒ»Ö±ÔÚÓÃÕâ¸ö¡£ border:0; Ö»ÊǶ¨Òå±ß¿ò¿í¶ÈΪÁ㣬µ«±ß¿òÑùʽ¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ