CSS word-wrap: break-word don't work on IE9

2019-02-21 10:12发布

I have a small css script that force <a> tag word-wrap in a div. It worked fine on FF, Chrome but didn't work on IE9. How can I fix it?

.tab_title a{
    word-wrap: break-word;
} 

9条回答
爷的心禁止访问
2楼-- · 2019-02-21 10:50

Try this:

.tab_title a{
    -ms-word-break: break-all;
    word-break: break-all;
    word-break: break-word;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    hyphens: auto;
} 
查看更多
萌系小妹纸
3楼-- · 2019-02-21 10:54

word-wrap: word-break; works only in ff and chrome and not in IE8 and IE9.
word-break: break-all; does not work either.

查看更多
Melony?
4楼-- · 2019-02-21 10:56

For a similar issue, I used display: inline-block on the <a> tag, which seems to help. And word-break: break-all as I was concerned with long URLs not wrapping.

So, this in your case essentially...

.tab_title a {
    display: inline-block;
    word-break: break-all;
} 
查看更多
登录 后发表回答