html - 文本使固定宽度的 td 变大

标签 html css html-table

我有一个固定宽度和背景图像的 td。当 td 中的文本比该宽度长时,它不会换行,它会扩展我的 td。为什么会这样?我该如何解决?

最佳答案

例子 http://jsfiddle.net/pqVYj/1/

您可以使用 CSS3 属性 word-wrap: break-word;.

更多在这里: https://developer.mozilla.org/En/CSS/Word-wrap

万一链接不起作用的代码示例:

p { width:13em; background:gold; word-wrap:break-word; }​

关于html - 文本使固定宽度的 td 变大,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8115765/

相关文章:

html - 如何阻止我的移动菜单将我的网站向下移动?

jquery - 悬停时在水平轴上倒置文本 - jquery 或 css

html - 如何通过pup从下一行选择值?

html - 如何在thead中安排内容

html - 表格与 div 对齐

jquery - 多个 jQuery niceScroll 插件

css - 多个 div 的 100% 高度

php - 删除奇怪的字体编码

jquery - 内容不适合 bpopup

css - 可以将背景颜色应用于未应用于边框的元素吗? (CSS)