<分区>
<分区>
我想让 white-space: pre
在 display: flex
容器中工作,但看起来 flexbox 阻止了 white-space: pre
从根本上工作。
fiddle
https://jsfiddle.net/silverwind/dhfkap6e应该呈现文本 Lost Whitespace
,同时保留我用于垂直居中的 flexbox。有什么方法可以在不引入包装器的情况下将这两者结合起来?
最佳答案
The white-space CSS property sets how white space inside an element is handled.
这里有 2 个元素,您必须在 flex 元素上指定边距或填充,或者您可以在 span 标签内添加一个空格
<span>Lost_</span>
关于css - 空白 : pre and flexbox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57105804/