gpt4 book ai didi

css - 在 flexbox 元素上使用 box-shadow 居中突出显示文本

转载 作者:行者123 更新时间:2023-11-28 17:19:19 26 4
gpt4 key购买 nike

我想将内联显示的文本居中,因为它需要高亮显示。例子: how I want to display the text

但是,当此文本位于具有 display flex 的 div 中时,它不起作用。显示内联不影响文本,它不能使用 flex 属性在 div 中居中(水平或垂直居中)。

最佳答案

只需在高亮文本和 display: flex div 之间放置另一个 div。在最外面的 div 上设置 text-align: center

关于css - 在 flexbox 元素上使用 box-shadow 居中突出显示文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42771074/

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