N
N
newhack2021-02-01 04:42:02
css
newhack, 2021-02-01 04:42:02

How to automatically calculate margin-left so that when resized it would give the same distance as in Bootstrap container?

The bottom line is that there is a site on the bootstrap grid, and I need to make a block that will not lie in the grid, but it must be centered exclusively on the grid, on the left side. Maybe someone came across how to calculate a similar thing, so that when resizing it would always fall into this distance?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri, 2021-02-01
@newhack

margin-left: calc(50vw - #{ширина контейнера / 2})
Of course, this is necessary for all breakpoints.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question