如何在HTML中创建颜色选择器? [英] How to create a color picker in html?

查看:249
本文介绍了如何在HTML中创建颜色选择器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何制作颜色选择器,就像我们在不同的网站上看到的那样,用户可以在其中向下滚动不同的颜色并单击以获取颜色代码?

How to make a color picker, like we see in different websites where users can scroll down different colors and on click can get the color code?

我尝试制作行和列,但是它并不那么舒适,所以希望它像一个颜色选择器

I have tried of making a rows and columns but it was not so comfortable so want it to be like a color picker

您可以看一下颜色框我是如何做到的:

You can take a look at the color box how i am trying it to be:

我经历了不同的问题,但无法解决此问题。

I have gone through different questions but I'm not able to solve this issue.

推荐答案

您可以简单地通过< input> 创建类型为颜色的颜色选择器。

You can simply create a color picker by <input> with type as color. But it works only in modern browsers.

<input name="Color Picker" type="color"/>

https://jsfiddle.net/itsselvam/9sL7s7ox/

这篇关于如何在HTML中创建颜色选择器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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