CSSÎÄ×Ö»»ÐÐÏêϸ½â˵
±¾ÎÄÁоÙÁ˼æÈÝ IE ºÍ FF µØ»»ÐÐ CSS ÍƼöÑùʽ,Ïêϸ½éÉÜÁËword-wrapͬword-breakµØÇø±ð.¼æÈÝ IE ºÍ FF µØ»»ÐÐ CSS ÍƼöÑùʽ£º
×îºÃµØ·½Ê½ÊÇ
word-wrap:break-word; overflow:hidden;
¶ø²»ÊÇ
word-wrap:break-word; word-break:break-all;
Ò²²»ÊÇ
word-wrap:break-word; overflow:auto;
ÕâÖÖ×îºÃµØ·½Ê½,ÔÚ IE ÏÂûÓÐÈκÎÎÊÌâ,ÔÚ FF ÏÂ,³¤´®Ó¢ÎĻᱻÕÚס³¬³öµØÄÚÈÝ.
¼¼Êõ×ܽ᣺
word-wrapÊÇ¿ØÖÆ»»ÐеØ.
ʹÓÃbreak-wordʱ,Êǽ«Ç¿ÖÆ»»ÐÐ.ÖÐÎÄûÓÐÈκÎÎÊÌâ,Ó¢ÎÄÓï¾äҲûÎÊÌâ.µ«ÊǶÔÓÚ³¤´®µØÓ¢ÎÄ,¾Í²»Æð×÷ÓÃ.
break-wordÊÇ¿ØÖÆÊÇ·ñ¶Ï´ÊµØ.
normalÊÇĬÈÏÇé¿ö,Ó¢Îĵ¥´Ê²»±»²ð¿ª.
break-all,ÊǶϿªµ¥´Ê.ÔÚµ¥´Êµ½±ß½çʱ,ϸö×Öĸ×Ô¶¯µ½ÏÂÒ»ÐÐ.Ö÷Òª½â¾öÁ˳¤´®Ó¢ÎĵØÎÊÌâ.
keep-all,ÊÇÖ¸Chinese, Japanese, and Korean²»¶Ï´Ê.¼´Ö»ÓôËʱ,²»ÓÃword-wrap,ÖÐÎľͲ»»á»»ÐÐÁË.£¨Ó¢ÎÄÓï¾äÕý³£.£©
IE주
ʹÓÃword-wrap:break-word;ËùÓеض¼Õý³£.
FireFox주
ÈçÕâ2¸ö¶¼²»Óõػ°,ÖÐÎIJ»»á³öÈκÎÎÊÌâ.Ó¢ÎÄÓï¾äÒ²²»»á³öÎÊÌâ.µ«ÊÇ,³¤´®Ó¢ÎÄ»á³öÎÊÌâ.
ΪÁ˽â¾ö³¤´®Ó¢ÎÄ,Ò»°ãÓÃword-wrap:break-word;word-break:break-all;.µ«ÊÇ,´Ë·½Ê½»áµ¼ÖÂ,ÆÕͨµØÓ¢ÎÄÓï¾äÖеص¥´Ê»á±»¶Ï¿ª£¨IEÏÂÒ²ÊÇ£©.
Ä¿Ç°Ö÷ÒªµØÎÊÌâ´æÔÚÓÚ ³¤´®Ó¢ÎÄ ºÍ Ó¢Îĵ¥´Ê±»¶Ï¿ª.Æäʵ³¤´®Ó¢ÎľÍÊÇÒ»¸ö±È½Ï³¤µØµ¥´Ê¶øÒÑ.¼´Ó¢Îĵ¥´ÊÓ¦²»Ó¦¸Ã±»¶Ï¿ªÄÇ£¿ÄÇÎÊÌâºÜÃ÷ÏÔÁË,ÏÔÈ»²»Ó¦¸Ã±»¶Ï¿ªÁË.¶ÔÓÚ³¤´®Ó¢ÎÄ,¾ÍÊǶñÒâµØ¶«Î÷,×ÔÈ»²»ÓÃÈ¥¹ÜÁË.µ«ÊÇ,Ò²ÒªÏëЩ°ì·¨,²»ÈÃËü°ÑÈÝÆ÷³Å´ó.
Óãºoverflow:auto; IEÏÂ,³¤´®»á×Ô¶¯ÕÛÐÐ.FireFoxÏÂ,³¤´®»á±»ÕÚ¸Ç.
ËùÒÔ,×ÛÉÏ,×îºÃµØ·½Ê½ÊÇword-wrap:break-word;overflow:hidden;¶ø²»ÊÇword-wrap:break-word;word-break:break-all;.
word-wrap:break-word;overflow:auto;ÔÚIEÏÂûÓÐÈκÎÎÊÌâ.ÔÚFireFoxÏÂ,³¤´®»á±»ÕÚס²¿·ÖÄÚÈÝ.
Ïà¹ØÎĵµ£º
CSS Hack ÊÇÔÚ±ê×¼ CSS û°ì·¨¼æÈݸ÷ä¯ÀÀÆ÷ÏÔʾЧ¹ûʱ²Å»áÓÃÉϵIJ¹¾È·½·¨,ÔÚ¸÷ä¯ÀÀÆ÷³§É̽âÎö CSS ûÓдï³ÉÒ»ÖÂÇ°,ÎÒÃÇÖ»ÄÜÓÃÕâÑùµÄ·½·¨À´Íê³ÉÕâÑùµÄÈÎÎñ¡£ÍøÉÏÄã¿ÉÄÜÄÜËÑË÷µ½Ò»´ó¶ÑµÄ CSS Hack£¬µ«ÊÇÎÒ½ñÌì·¢²¼µÄÄã¿ÉÄܲ¢²»¶¼ºÜÁ˽⣬ÒòΪÕâЩ¶¼ÊÇÖ»Õë¶Ôµ¥¶ÀÒ»¸öä¯ÀÀÆ÷µÄ CSS Hack¡£
ΪÁËÏòÄãչʾÕâЩ CSS Hack ÊÇ·ñÕý³£Ô ......
<!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=utf-8" />
<title>www.zishu.cn< ......
×î¼òµ¥µÄ°ì·¨£º¼ÙÉèÄãÓÐÁ½¸öÑÕÉ«µÄCSSÎļþred.css,green.css,ĬÈÏΪºìÉ«µÄÑùʽ
<link rel="stylesheet" style="text/css" link="red.css" id="colorcss">
<input type="button" name="redcss" value='ºìÉ«' onclick="javascript:document.getElementById('colorcss').href='red.css'">
<input type="butt ......
µ±DIV+CSSƽµØÆð¾ªÀ×ͻȻ³öÏÖÔÚÍøÒ³Éè¼ÆÐÐÒµµÄʱºò£¬¹Ù·½¡¢Ãñ¼äÎÞ²»ÍƳ籸ÖÁ£¬·Â·ðTableÉè¼ÆµÄʱ´ú¾ÍÒªÖսᣬÂí
ÉϾÍÒª²½ÈëDIV+CSSµÄʱ´ú£¬²»¶®µÃDIV+CSSÄ㶼²»ºÃÒâ˼˵Äã»áÍøÒ³Éè¼Æ£¬²»ÖªDIV+CSSÄ㶼²»ºÃÒâ˼˵ÄãÊÇÕ¾³¤£¬Äã
Òª»¹ÊÇÓÃTABLEÀ´Éè¼ÆÕ¾µã£¬ÎÞÊý±ÉÒÄÖ®¹â¾ÍͶÉä¶øÀ´¡£
¡¡¡¡È»¶øDIV+CSSÕæµÄÓÐÕâôÉñÂð?¸ÃÔõà ......