如何覆盖引导程序类? [英] How can I override bootstrap classes?

查看:30
本文介绍了如何覆盖引导程序类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想覆盖特定元素上的引导程序默认样式,但没有使用重要属性,有什么办法可以做到这一点,有时!重要属性不起作用,我正在创建引导程序表单,但是当我尝试为任何表单控件提供宽度然后它不适用为什么?

I wanted to override bootstrap default styles on a particular element ,but instead of using important property ,is there any way to do that , sometimes the !important property don't work , i was creating bootstrap form but when i tried to give width to any form control then it didn't apply why ?

推荐答案

我认为您应该处理 CSS 优先级.

I think you should work with the CSS priorities.

有一个类似的主题,您可以在其中找到有关它的有用信息此处: 覆盖 bootstrap css 的最佳方法

There is a similar topic where you can find helpful info about it Here: best way to override bootstrap css

此外,在以下链接中有一个关于特异性的示例,如果您应该尝试在代码中定位需要更改的元素此处: CSS 类优先级

Additionally, in the following link there is a sample about specificity were you should try in your code to target the elements you need to change Here: CSS class priorities

如果可能,请分享一些您遇到问题的代码示例.

If possible share some samples of your code where you have issues.

这篇关于如何覆盖引导程序类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆