EN
HTML - color input
0 points
In this article, we would like to show you how to use color input element in HTML.
Quick solution:
xxxxxxxxxx
1
<input type="color" name="background" value="#FF0000" />
In this example, we use the input
element's type="color"
attribute to create a color picker for the background.
xxxxxxxxxx
1
2
<html>
3
<body>
4
<div>
5
<input type="color" id="background" name="background" value="#FF0000" />
6
<label for="background">Background color</label>
7
</div>
8
</body>
9
</html>