Jump to content

Trying to avoid problem with type=color


Recommended Posts

I recently had occasion to use

<input type="color">

It seemed like a nice idea until I viewed it on an IE 11 browser.

Since IE11 does not support the tag, it provided a text input instead of the COLOR input functionality.

The input field CAN be used as a substitute as long as acceptable color NAMES are typed, but the field size is much wider than it would be as type=color in a newer browser (and that alters the page layout).

Since a user COULD be using an older browser, it seems that controlling the WIDTH of the input should solve that problem.

The real issue is a way to create a script to determine whether the setting adjustment is even necessary.

Something like

if (input [type='color'] != a cute button with a color graphic) {
  input.width = 10px;

Insightful responses, please.

PS: While on the topic, does anyone happen to know the DEFAULT settings for input="text" with regard to the height, width, font size, font family of the field?




Edited by phppup
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.