小编bme*_*eck的帖子

防止内联块包裹在空白区域上:pre?

似乎Chrome正在包装一个内联块元素,如果它在一行的末尾,即使有一个white-space:pre容器,它周围有overflow:auto.有没有可行的解决方案来防止这种情况发生而不改变内容?

<div style="width:400px;height:200px;overflow:auto;white-space:pre">
The span should be at the end of this text, however, it wraps to the next line.<span style="width:1px;display:inline-block;height:1em;background:red"></span>
</div>
Run Code Online (Sandbox Code Playgroud)

必须至少使用换行符保留空白区域.可以压缩空格和制表符.

css word-wrap

12
推荐指数
2
解决办法
4700
查看次数

标签 统计

css ×1

word-wrap ×1