我的页面中首先有两个 css:bootstrap css,其次是我的自定义样式。
在 Bootstrap 中有一个样式定义:border-left: 0 none;
在第二种样式中我想中和它。
我该怎么做?
最佳答案
试试 border-left: initial;
“initial 关键字用于将 CSS 属性设置为其默认值。” - W3 Schools | Initial Property
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
div {
width: 100px;
height: 100px;
background-color: gray;
border-style: solid;
border-width: 10px;
border-color: black;
}
div {
border-left: 10px;
}
div {
border-left: initial;
}
<div></div>
fiddle
关于css - 如何中和左边界 : 0 none with overriding,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43702795/