CSS / JavaScript: Twitter Bootstrap center modal vertically on mobile web view

I’ve been working with modal boxes using Twitter Bootstrap. And the page I’m working on needs to be viewed in mobile devices. The modal looks nice and centered when viewed on desktop, but when run in mobile web browsers, it’s aligned to the top.

Someone on StackOverflow suggested the use of a helper div plus some custom CSS to align Bootstrap modals vertically.

Code for modal:

CSS:

Source: Vertically centering Bootstrap modal window

Related Posts:

Posts that may be related to "CSS / JavaScript: Twitter Bootstrap center modal vertically on mobile web view":

Catzie

A Filipino programmer with a variety of interests such as baking, singing, making up silly song/rap lyrics, K-pop, drawing, creating unique dessert flavors, obsessing about finding out how some things works, board games, anime, video games, and forgetting things that usually go in her long list of interests. Running small-time online dessert shops Cookies PH and Catzie's Cakery.

Leave a Reply

Your email address will not be published. Required fields are marked *