【问题标题】:How can i inherit only few of the properties of a bootstrap pre-defined class?我怎样才能只继承引导预定义类的几个属性?
【发布时间】:2019-09-11 10:36:11
【问题描述】:

我添加了一个引导类,我想删除背景颜色并将不透明度添加到预定义类。 有没有可以轻松完成的功能?

<div class="btn-group ">
<a class="btn btn-sm btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-info-circle"></i>
</a>
<div class="dropdown-menu dropdown-menu-right">
<ul>
<li class="dropdown-item"><a class="btn btn-sm btn-primary" title="Update patient info">Phone-Number</a></li>
<li class="dropdown-item"><a class="btn btn-sm btn-primary"title="Update patient info">Patients Details</a></li>
</ul>
</div>
</div>



Note:
when i inspect phone number it gives me background white color and on disabling it gives the desired result.
now, how can i add that to my internal css so that its remains like that

【问题讨论】:

  • 使用 style 属性做内联 CSS。希望这会有所帮助
  • 你可以使用 sass 函数并扩展它

标签: css twitter-bootstrap-3 bootstrap-4


【解决方案1】:

应用于标签 ID 的样式将优先于应用于类的样式。

给你想要设置样式的标签添加一个id,并将css添加到id中。如果您已经为某个类编写了样式,请将 ID 选择器添加到它们。

内联 css 也可以,但不推荐。

【讨论】:

  • 以及如何删除引导类提供的属性
  • 你不能从 bootstrap 中移除一个属性,你只能覆盖它。
猜你喜欢
  • 2018-10-22
  • 1970-01-01
  • 2022-12-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-04-03
  • 2021-04-27
相关资源
最近更新 更多