V
V
Valentyn Kovalyk2020-10-27 16:52:23
css
Valentyn Kovalyk, 2020-10-27 16:52:23

How to increase margin/padding in Bootstrap?

by default m-5/p-5 has a value of 3rem, how to increase this value?
I don't even understand, or do I need to do it with css?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sashabeep, 2020-10-27
@xo4yxypmy

This is a set of default indentation utilities that you want from them.
You can override them in the source. But why, if one way or another in 99% of cases you will write styles for your element. Write padding for this element in your css

S
Semyon Kuznetsov, 2020-10-27
@zloy_kot_developer

First, don't use bootstrap. It used to be a good library, but now it's not needed. Got Flexbox!
Secondly, according to the experience of using bootstrap. If you are changing the standard indentation, then you are doing something wrong. Most likely, by fixing one indent, you will pin the entire layout on crutches.
And finally thirdly. Nothing prevents you from doing this and finally breaking everything:

body .m-5, body .p-5 {
    padding: 0 5rem;  /* Если не сработает, то исправьте на padding: 0 1rem !important; */
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question