在chrome中输入样式[type = date] [英] Styling input[type=date] in chrome

查看:392
本文介绍了在chrome中输入样式[type = date]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是html5日期输入,但是Chrome以新的格式未正确显示完整值。格式为DD-MM-YYYY,但YYYY部分显示空白。虽然我可以看到这个值。



似乎输入右侧的空白区域是为控件保留的(交叉清除值,向上/向下箭头,下拉箭头)。

我没有空间让输入变宽。如何使整个日期可见?



示例:
http://jsfiddle.net/U6MYy/

 < input type =datevalue = 2014年4月7\" 日/> 
with
input {width:80px; }


解决方案

此处:

Chrome输入日期错误



显然是固定的,但不能设法使它在这里工作:



http://trac.webkit.org/changeset/141195



您现在的快速解决方案是将宽度设置为最小值 130px



更新:查看此答案,它可能会帮助您: https://stackoverflow.com/ a / 15107073/3448527


I'm using html5 date input, but in a new form Chrome is not displaying the full values correctly. The format is DD-MM-YYYY, but the YYYY part shows up blank. I can see the value is there though.

Seems as if the white space on the right side of the input is reserved for the controls (cross to clear value, up/down arrow, dropdown-arrow).

I don't have space to make the input wider. How to make the full date visible?

Example: http://jsfiddle.net/U6MYy/

<input type="date" value="2014-04-07"/>
with
input { width: 80px; }

解决方案

This is a chrome bug which you can read about here:

Chrome Input Date Bug

apparently fixed, but can't managed to make it work their patch here:

http://trac.webkit.org/changeset/141195

your quick solution right now is set width to minimum 130px

UPDATE: see this answer, it might help you: https://stackoverflow.com/a/15107073/3448527

这篇关于在chrome中输入样式[type = date]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆