S
S
Sergey Evstigneev2016-12-01 17:41:35
css
Sergey Evstigneev, 2016-12-01 17:41:35

Why does the layout shift when the modal is called?

On the site , the language change is implemented through a modal window. So when the modal opens, the entire layout shifts ~15px to the left. I can't figure out where I screwed up. Can you tell me?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex Glebov, 2016-12-01
@sergevstigneev

bootstrap, when the modal opens, adds body padding-right according to the scroll size and overflow: hidden
so that the page under the open modal does not scroll

.modal-open {
    overflow-y: auto !important;
}

because of this code, the scroll is not removed from you

I
iBird Rose, 2016-12-01
@iiiBird

It is better to fix only what has left. write down:

.modal-open ul.nav.navbar-nav.pull-right {
    padding-right: 17px;
}

ps and remove .modal-open {overflow-y: auto !important;}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question