CSS word-wrap:break-word 在 IE8 中不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3997223/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 23:00:55  来源:igfitidea点击:

word-wrap:break-word not working in IE8

cssinternet-explorer-8word-wrap

提问by Sixfoot Studio

Can anyone please tell me why word-wrap: break-wordwill not work in IE8?

谁能告诉我为什么word-wrap: break-word不能在 IE8 中工作?

I have this working in other browsers but IE8 refuses to listen despite reading this post on their site?

我可以在其他浏览器中使用它,但 IE8 尽管在他们的网站上阅读了这篇文章,但仍然拒绝收听?

http://msdn.microsoft.com/en-us/library/ms531186(VS.85).aspx

http://msdn.microsoft.com/en-us/library/ms531186(VS.85).aspx

Thanks

谢谢

采纳答案by Frédéric Hamidi

If I recall correctly, word-wrap: break-word;is indeed supported in Internet Explorer 8, but the styled element must have layout.

如果我没记错的话,word-wrap: break-word;Internet Explorer 8 确实支持,但样式元素必须具有 layout

回答by Marc Stober

I found that to apply word-wrapto a td(table cell) I needed to style the tableelement with table-layout: fixed. (IE8 standards mode.)

我发现,适用word-wraptd(表格单元格),我需要的风格table与元素table-layout: fixed。(IE8 标准模式。)

回答by Satish Sharma

Try this word-break: break-all;, for IE8 and IE9 it is working :)

试试这个 断句:break-all;,对于 IE8 和 IE9,它正在工作:)

回答by Abhishek Mehta

You can use

您可以使用

-ms-word-break: break-all;

回答by Magnus

After looking at this example code from Microsoft:
https://msdn.microsoft.com/en-us/library/ms531186%28VS.85%29.aspx

查看来自 Microsoft 的此示例代码后:https:
//msdn.microsoft.com/en-us/library/ms531186%28VS.85%29.aspx

I managed to fix my issues with IE-8 with the following addition to the document and header:

我在文档和标题中添加了以下内容,设法解决了 IE-8 的问题:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

...and then use this (official) CSS directive:

...然后使用这个(官方)CSS 指令:

word-wrap: break-word;