css - 空白 : pre and flexbox

标签 css flexbox

我想让 white-space: predisplay: 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/

上一篇:html - 并非所有 div 都显示为全宽

下一篇:javascript - 当我从浏览器控制台禁用 javascript 时,预加载器图标未隐藏

相关文章:

html - 如何防止显示:flex item from clearing the previous float?

html - 使 flexbox 匹配其父级的宽度

css - 如何缩放多个图像以填充区域

css - 将 fotorama 缩略图向左对齐

html - 当我将鼠标悬停在下拉菜单上时,我怎样才能让它停留在那里?

html - 使用具有多个 id 的 H 选择器时如何缩短 CSS?

react-native - 用破折号 react 字符串的原生文本分词策略

css - 行内嵌套的 flexbox 列,带有全高子项

css - IIS - 浏览文件时拒绝访问

css - Rails 中 CSS 放置的问题(使用 bootstrap)