M
M
Michael R.2018-06-02 09:44:38
css
Michael R., 2018-06-02 09:44:38

How to set a non-standard width for a Bootstrap column?

Greetings!
For example, there are 2 columns, but the column width in `col-sm-4` is too small when the column width in `col-sm-5` is already too large.
How does Bootstrap set the width of the column, which, for example, will be between the specified `col-sm-4` and `col-sm-5`?
Thank you!

<div class="container">
<div class="row">
<div class="col-sm-4"></div>
<div class="col"></div>
</div>
</div>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
archelon, 2018-06-02
@Mike_Ro

in such a case, just don't use the standard bootstrap markup.

L
La1serg, 2018-06-02
@La1serg

How does Bootstrap set the width of the column, which, for example, will be between the specified `col-sm-4` and `col-sm-5`?

None.
In such cases, I add my own class to bootstrap.css, for example "col-sm-4-whalf", and calculate what its width should be equal to. The sm-4 has a width of 33.333333%, the sm-5 has a width of 41.666667%. Add up, get 75%, divide by two. The total width of our 4-and-a-half column is 37.5%.
But in general, when designing a site, it is necessary to determine the tools so that there are no such problems.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question