如果是很长的文本行,我希望它不换行地延伸
最佳答案
尝试
span
{
white-space: pre;
}
或any other value that fits from the w3c spec :
normal
This value directs user agents to collapse sequences of white space, and break lines as necessary to fill line boxes.pre
This value prevents user agents from collapsing sequences of white space. Lines are only broken at preserved newline characters.nowrap
This value collapses white space as for 'normal', but suppresses line breaks within text.pre-wrap
This value prevents user agents from collapsing sequences of white space. Lines are broken at preserved newline characters, and as necessary to fill line boxes.pre-line
This value directs user agents to collapse sequences of white space. Lines are broken at preserved newline characters, and as necessary to fill line boxes.
You should also be aware that there is limited IE support for some of the listed options .
警告,跨浏览器内容困惑:您可以将行中的所有空格替换为
关于css - 如何强制 `span` 不在行尾换行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7015317/