Answer the question
In order to leave comments, you need to log in
How to override Bootstrap system styles?
Need help. Let's take a special case. Bootstrap v4.0.0-beta .
I connected it means navbar:
<div class="container">
<nav class="navbar navbar-expand-lg navbar-light">
<a class="navbar-brand" href="#">...</a>
</nav>
</div>
padding: .5rem 1rem;
that are in _navbar.scss:18
. Answer the question
In order to leave comments, you need to log in
Do not touch bootstrap files.
Override with one of 2 methods:
1) Connect your css below the bootstrap, write in it for example
.navbar{
padding: 2rem 0.5rem;
}
.myclass{
padding: 2rem 0.5rem;
}
well, as it were, no one forbade adding the px-0 class to the element, in fact
, this way it will give zero padding by x in quite a standard way.
but if you change it globally, then for example I have a bs4custom.css file, where the default styles that are in BS4 are overridden, and a custom.css file for my other styles
You can write your own CSS rule on the page where this navigation appears. I think to redefine properties.
Ay, there will be no witchcraft, you don’t have an Orthodox bootstrap, but a Shaitan 4th one. It will not be possible to collect it from what was on the site.
Climb into the sass file and substitute your value, sass differs only in that there are no parentheses and semicolons.
It turns out that just download the source code only not css, but what do they have scss? %)
To not use !important, the overriding rule must be declared after the rule being overridden, or must have a higher precedence. About Google post priorities, a simple example:
#caption {...}
.caption {...}
For an element, the
first rule will override the second, since it has a higher priority.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question