iOS safari messes up input type=date
This is the way iOS treats input type="date"
. I wouldn't worry about native styling. It may look off, but people using iOS are used to it.
You can use min-width:95%
on the date input. It makes it fit, at least in iOS 8, and doesn't change the appearance otherwise. Though I haven't tested in Android or earlier version of iOS. Alternatively, to just center it, you can add .center-block
to the input, so at least it's center and doesn't look so off.
DEMO: http://jsbin.com/civor/1/
.input-min-width-95p {min-width:95%;}
HTML:
<input type="date" class="form-control input-min-width-95p" ...
HTML5 date picker doesn't show on Safari
Safari does not include a native datepicker for its desktop version (although it does for iOS). Incidentally, neither does IE. It's very frustrating as it could save developers a lot of time if they did.
This is a useful link for tracking support for it: http://caniuse.com/#feat=input-datetime
Set a value to an input type=“date” on mobile Safari using JavaScript
The final solution I went with (as I could not get Safari to recognize any input) was to change the type to text after attaching all the JavaScript hooks and adding the readonly attribute. This allowed Safari to function just like all other browsers, but still work when JavaScript is disabled.
Why is the date input squished on iphone only?
iOS Webkit is trying to add it's own styling. As stated in the comments and on this post, removing the default appearance works. Also, class="appearance-none"
with Tailwind css
works great too
Related Topics
Directory Chooser in HTML Page
Force Element to Display Outside of Overflow:Hidden
Using Mailto to Send Email With an Attachment
Zoom to Fit: Pdf Embedded in HTML
How to Declare a Variable in a Template in Angular
How to Toggle Mat-Expansion-Panel With Button Click
Angular: *Ngif Tag on Input Element Causes It to Be Undefined. Cannot Read Value from Input Field
Vertically Align Text Next to an Image
Floated Elements of Variable Height Push Siblings Down
How to Run a HTML File from Terminal
How to Make a Gap Between Two Div Within the Same Column
How to Avoid Element from Expanding When Its Content Text Font-Size Gets Bigger
Having Difficulty Understanding How to Remove Some Padding
Background Size for Mobile Devices
Make Container Shrink-To-Fit Child Elements as They Wrap