【发布时间】:2020-11-07 10:34:21
【问题描述】:
我正在尝试使用React Emotion 设置一条中间有文字的水平线。它看起来像这样:
----------------------SOME TEXT----------------------------------
我在 StackOverflow 上找到了有关如何使用 CSS 执行此操作的示例,但它对我不起作用。
这是我正在使用的 DIV,但它不起作用。
这可以用 react Emotion 设置吗?我错过了什么?
<div
css={{
display: 'flex',
lineHeight:'1em',
color:'gray',
'&:before, &:after': {
content:'',
display:'inline-block',
flexGrow:'1px',
marginTop:'0.5em',
backgroundColor:'gray',
height:'1px',
marginRight:'10px',
marginLeft:'10px'
}
}}
>
SOME TEXT
</div>
【问题讨论】: