Answer the question
In order to leave comments, you need to log in
How to vertically align bootstrap 4 windows?
Hello. There was a task to make a block in the middle of the window, both vertically and horizontally. For the life of me, I can't figure out how to center relative to the window. Can someone tell me how to do this in bootstrap 4?
Now it’s like this:
But you need to do it like this:
At the same time, you need to do something like that, regardless of the width and height of the browser window, the block always remains in the center (preferably when resizing that too)
Answer the question
In order to leave comments, you need to log in
And you are his flexes, flexes!
.block-wrapper {
display: flex;
align-items: center;
justify-content: center;
}
d-flex
, align-items-center
, justify-content-center
, postscripts sm
, md
, lg
, xl
, too.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question