Input type “color”?

2019-02-22 08:50发布

问题:

I checked out some input type from HTML5 and I found out that the chrome support for the input type color doesn't work. My chrome version is 15.0.874.121 and the w3schools site says that it's supported since the version 12 :

My question is just : why that doesn't work for me? Is it a regression of the HTML5 support in Chrome?

回答1:

I’ve got standalone versions of Chrome for testing (see http://www.oldapps.com/google_chrome.php), and neither Chrome 12, 13 or 15 seem to support <input type="color"> — they all just show a text field. (As opposed to Opera 11, which shows a colour picker.)

The Reddit article linked to in @WebDeveloper’s answer says that html5test.com reports Chrome 12 as supporting field validation on <input type="color">. This is true — html5test.com does report that for Chrome 12 (and doesn’t for Chrome 15), but I’m not sure what that actually means.



回答2:

w3school is not a official doc. It has lot of errors. It's partially right though in this case. Just see this site http://w3fools.com/

As far as input type color is supported check this

Following browsers now supports color widget

Firefox 29

Opera Desktop 11

Chrome Desktop 20:

Android 4.4 / Chrome Mobile :

Opera mobile:

Blackberry:

Firefox os 1.3

Firefox os now supports color input but i still don't have a screen shot

This link/info is now old

http://www.reddit.com/r/browsers/comments/is1q9/does_chrome_safari_and_firefox_support_input/

Chrome 12: partial (minimal element support: yes, custom ui: no, value sanitization: no, field validation: yes)     
Safari 5.0.1: partial(minimal element support: yes, custom ui: no, value sanitization: no,field validation: yes)     
Opera 11.50: partial (minimal element support: yes, custom ui: yes, value sanitization: yes, field validation: no)    
IE 9: No
Firefox 5: No 

If u want u can use this http://www.eyecon.ro/colorpicker/



回答3:

<input type="color" /> is currently in development and is not yet implemented.

See:

http://code.google.com/p/chromium/issues/detail?id=83865

http://code.google.com/p/chromium/issues/detail?id=82635