【问题标题】:word-wrap feature not working in chrome自动换行功能在 chrome 中不起作用
【发布时间】:2014-04-28 11:38:36
【问题描述】:

我正在使用以下样式表代码来实现表格列中的自动换行:

<style type="text/css">
    table,td {  
        table-layout: fixed;        
    }
</style>

这段代码在firefox中运行良好,我可以实现自动换行,但是当我在chrome浏览器中尝试时,它不起作用。

您能否建议如何让它在所有浏览器(IE、firefox、chrome)中运行

【问题讨论】:

  • 你能做个小提琴吗
  • 您是否正在设置表格或其单元格的宽度...?

标签: javascript html css google-chrome


【解决方案1】:

试试这个属性到css

word-break: break-all;

【讨论】:

    【解决方案2】:

    也许将word-wrap: break-word 属性添加到css

    【讨论】:

    • 我已经试过了。它在 Firefox 中运行良好,但在 chrome 中运行良好。
    • 在 chrome 中,可以使用 word-break: break-word
    • @KonstantinKrass 非常感谢!!您应该将其编辑为答案,因为它是 100% 正确的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-27
    • 1970-01-01
    • 1970-01-01
    • 2023-03-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多