Today I read about HTML5\'s color input and I thought I\'d give it a try:
The positioning of the input
of type color
is browser-specific implementation, in the official documentation there is no given rule for user-agents (i.e. browsers) how to position it over the page's element. This makes custom positioning via CSS for example, or JavaScript not possible.
However, there are some other rules (for example, there is always a color picked, and there is no way to set the value to the empty string.)
Keep in mind when using the input
of type color
, that Internet Explorer and Safari browsers do not support it yet.
I had this same question. I wanted to create a Theme editor and wanted to do this. Like the VS Code when editing a CSS file. I figured out some strategies for solving this problem:
Method A using positioned iframe and signalling changes between iframe and parent.
Method B using window.open(…)+ Ajax