Bootstrap 4 - modify container width

0

In a standard way the bootstrap container 4 has a maximum of 1,140px. How do I make the maximum width of the container 1,280px (80rem)? And how to make adjustments so that the grid is always a percentage but with respect to the new value of the container? I hope to have explained. Any ideas?

    
asked by Mario Campos 17.09.2018 в 08:16
source

2 answers

1

One of the good things about Bootstrap is that grid does not work with fixed measures, but with relative to the parent that contains the elements. This way, if you change the size of the container , its operation, in principle, would not be affected.

There are many ways to change the size of the container , I would like to recommend two:

  • You can choose to change the CSS core of Bootstrap "bootstrap.min.css" where all CSS rules are specified that make Bootstrap work.

  • You can also create a specific rule in your own CSS that is set by Bootstrap . Example:

CSS

#miSection .container {
    width: 1280px !important;
}

Personally, I would take the second one. Since I like to avoid touching the kernels of libraries and plugins if it's in my hand.

    
answered by 17.09.2018 в 09:05
0

Dear, I found a great idea and it works perfect without having to touch bootstrap:

<div class="container-fluid">
	<div id="mycontainer" class="container">
    </div>
</div>

Style sheet:

#mycontainer {
    max-width: 1280px !important;
}
    
answered by 18.09.2018 в 00:49