snowfox373 2007-12-9 21:44
CSS技巧:word-wrap同word-break的区别
本文列举了兼容 IE 和 FF 的换行 CSS 推荐样式,详细介绍了word-wrap同word-break的区别。
#P3T;_+\xY3S.fN)K
q*{0Z6lU|v
兼容 IE 和 FF 的换行 CSS 推荐样式
;Z"i_V-L8?
~`p [,}k:Ndl{9j
最好的方式是[code]word-wrap:break-word; overflow:hidden;[/code]而不是[code]word-wrap:break-word; word-break:break-all;[/code]也不是[code] word-wrap:break-word; overflow:auto;[/code] 在 IE 下没有任何问题,在 FF 下,长串英文会被遮住超出的内容。
o!XD$V_9h
M(o-E in8WM
word-wrap同word-break的区别4oA0Y!A,jyQN9W
)W9`c0[s3n0x:~#k)Y
word-wrap:
M3xvH#l;T5W2hOt
oWWI6A P
yey
normal Default. Content exceeds the boundaries of its container.
}:wr:Ni Vo1P|fc%~
8z7_H },s
break-word Content wraps to next line, and a word-break occurs when necessary. 必要时会触发word-break。
pd,@4j+T0P
7P:N&fzI*J;m
word-break:
HLGmrk2`
"s3DF:n"B;DM
normal Default. Allows line breaking within words. 好像是只对Asian text起作用。
E2L6Y2HX x
8WZxIU-k#c3?
break-all Behaves the same as normal for Asian text, yet allows the line to break arbitrarily for non-Asian text. This value is suited to Asian text that contains some excerpts of non-Asian text.:S|d T#}9w \
'ln+@U dU
keep-all Does not allow word breaking for Chinese, Japanese, and Korean. Functions the same way as normal for all non-Asian languages. This value is optimized for text that includes small amounts of Chinese, Japanese, or Korean.
{CO2L ~#Q
NYB7jVa$X+\
总结如下:
&}? {4a~&z~P
,CbE/FC(KJ
word-wrap是控制换行的。