开发者

Word wrapping in a span in IE8

开发者 https://www.devze.com 2023-02-13 06:08 出处:网络
I am attempting to get word wrapping to work in a span.Currently I am using \"word-wrap:break-word;\" which works in mo开发者_JAVA技巧st browsers, however there is a requirement for word wrapping to w

I am attempting to get word wrapping to work in a span. Currently I am using "word-wrap:break-word;" which works in mo开发者_JAVA技巧st browsers, however there is a requirement for word wrapping to work in IE8.

Are there any other methods of doing this which will support more browsers?


It appears that word-wrap: break-word is broken in IE when using on an inline element, even if its enclosing block defines a width. Finally figured out that it works on blocks. If you want to make it work on a span you must set the display property to inline-block or replace the span with a div or a p.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号