gpt4 book ai didi

css - `word-break: break-word` 的替代品

转载 作者:技术小花猫 更新时间:2023-10-29 11:41:46 34 4
gpt4 key购买 nike

是否有 word-break: break-wordalternative 可以在 firefox 中使用?

在 firefox[版本 57.0] 中

enter image description here

在 Chrome [版本 62.0.3202.94] 中

enter image description here

有没有一种方法或替代方法可以在 firefox 中使用 break-word 属性。? [如果它适用于旧版本,那就更好了。]

示例代码

table {
width: 300px;
display: inline-block;
overflow: hidden;
word-break: break-word;
}

.text-right {
width: 30%;
}
<table>
<tr>
<td class="text-right">Sample text </td>
<td>Sample texttexttexttexttexttexttexttext 000000000000000000000000000000</td>
</tr>
</table>

最佳答案

valid values of word-break如下:

/* Keyword values */
word-break: normal;
word-break: break-all;
word-break: keep-all;

/* Global values */
word-break: inherit;
word-break: initial;
word-break: unset;

The word-break CSS property specifies whether or not the browser should insert line breaks wherever the text would otherwise overflow its content box.

Chrome, Safari and other WebKit/Blink browsers also support the unofficial break-word value which is treated like word-wrap: break-word.

那么你可以使用 word-wrap: break-word 代替吗?

关于css - `word-break: break-word` 的替代品,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47413677/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com