css - 如何中和左边界 : 0 none with overriding

标签 css twitter-bootstrap

我的页面中首先有两个 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

https://jsfiddle.net/Hastig/nhkuu7ks/

关于css - 如何中和左边界 : 0 none with overriding,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43702795/

相关文章:

html - 更多 HTML/CSS [min-]height 问题

javascript - slider 加载问题

jquery - Bootstrap show.bs.modal 事件在 Firefox 上不起作用

html - 对齐不同行中 Bootstrap 列中的输入

javascript - 下一个选项卡显示内容,但选项卡不跟随

javascript - 播放 Vimeo 视频时暂停 Bootstrap 轮播

javascript - CSS3 transition 和 transform 在类移除时效果不佳

javascript - 如何使用下一步按钮将步骤向导链接到菜单

php - 我如何根据 PHP 的纵横比将类应用于图像?

css - Bootstrap 轮播,在移动设备上更改幻灯片内容?