【发布时间】:2019-11-04 20:22:59
【问题描述】:
我正在尝试在文本之前和之后应用边框。它适用于除 Microsoft Edge 和 Internet Explorer 之外的所有浏览器。我正在使用 display: flex,详情请参考我的代码
我尝试将 max-width 设置为 100% 并添加 box-sizing:border-box 但似乎不起作用
const text = styled(div)`
display: flex;
align-items: center;
color: gray;
margin-bottom: 24px;
::before, ::after {
content: '';
width: 100%;
border-top: 1px solid gray;
}
::before {
margin-right: 8px;
}
::after {
margin-left:8px;
}
`;
<text>OR</text>
我还需要在 IE 11 中显示边框
【问题讨论】:
-
它只是偶尔中断
-
在 ::before ::after 上显示块或内联块可能会有所帮助。
-
我试过了,但是当我重新加载两次或三次时它仍然会中断
标签: css flexbox internet-explorer-11 microsoft-edge