Skip to content

Instantly share code, notes, and snippets.

@ebukahills
Last active January 29, 2019 09:14
Show Gist options
  • Save ebukahills/689acc9ffeecdcb28cc125a187d60b93 to your computer and use it in GitHub Desktop.
Save ebukahills/689acc9ffeecdcb28cc125a187d60b93 to your computer and use it in GitHub Desktop.
Fix Form Issues on iOS devices where page zooms in when a form input is clicked
/*
iOS Form Input zoom-in fix
*/
/* iPhone < 5: */
@media screen and (device-aspect-ratio: 2/3) {
select,
textarea,
input[type='text'],
input[type='password'],
input[type='datetime'],
input[type='datetime-local'],
input[type='date'],
input[type='month'],
input[type='time'],
input[type='week'],
input[type='number'],
input[type='email'],
input[type='url'],
#amount-input {
font-size: 16px;
}
}
/* iPhone 5, 5C, 5S, iPod Touch 5g */
@media screen and (device-aspect-ratio: 40/71) {
select,
textarea,
input[type='text'],
input[type='password'],
input[type='datetime'],
input[type='datetime-local'],
input[type='date'],
input[type='month'],
input[type='time'],
input[type='week'],
input[type='number'],
input[type='email'],
input[type='url'],
#amount-input {
font-size: 16px;
}
}
/* iPhone 6, iPhone 6s, iPhone 7 portrait/landscape */
@media screen and (device-aspect-ratio: 375/667) {
select,
textarea,
input[type='text'],
input[type='password'],
input[type='datetime'],
input[type='datetime-local'],
input[type='date'],
input[type='month'],
input[type='time'],
input[type='week'],
input[type='number'],
input[type='email'],
input[type='url'],
#amount-input {
font-size: 16px;
}
}
/* iPhone 6 Plus, iPhone 6s Plus, iPhone 7 Plus portrait/landscape */
@media screen and (device-aspect-ratio: 9/16) {
select,
textarea,
input[type='text'],
input[type='password'],
input[type='datetime'],
input[type='datetime-local'],
input[type='date'],
input[type='month'],
input[type='time'],
input[type='week'],
input[type='number'],
input[type='email'],
input[type='url'],
#amount-input {
font-size: 16px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment