Skip to content

Instantly share code, notes, and snippets.

@msroot
Created October 5, 2012 14:59
Show Gist options
  • Select an option

  • Save msroot/3840320 to your computer and use it in GitHub Desktop.

Select an option

Save msroot/3840320 to your computer and use it in GitHub Desktop.
Fix modal for phone devices (@media (max-width: 480px))
/*MODAL FIXES*/
@media (max-width: 480px) {
.modal {
height: 500px; /* Set a default max height of the modal (adjusted later)*/
position: fixed; /* Display modal in the centre of your screen */
overflow-y: scroll; /* Ensure that the modal is scroll-able */
-webkit-overflow-scrolling: touch; /* Avoid having to use 2 finger scroll on iOS */
}
.modal.fade.in{
top: 5px;
}
.modal-body{
max-height: 2400px;
}
.modal h3 {font-size:15px}
}
@media (max-width: 480px) and (max-height: 500px){.modal{ height: 450px}}
@media (max-width: 480px) and (max-height: 450px){.modal{ height: 400px}}
@media (max-width: 480px) and (max-height: 400px){.modal{ height: 350px}}
@media (max-width: 480px) and (max-height: 350px){.modal{ height: 300px}}
@media (max-width: 480px) and (max-height: 300px){.modal{ height: 250px}}
@media (max-width: 480px) and (max-height: 250px){.modal{ height: 200px}}
@media (max-width: 480px) and (max-height: 200px){.modal{ height: 150px}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment