How to position a color picker opened through HTML5's color input?

前端 未结 2 1716
春和景丽
春和景丽 2020-12-20 12:14

Today I read about HTML5\'s color input and I thought I\'d give it a try:

2条回答
  •  悲哀的现实
    2020-12-20 12:20

    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.

提交回复
热议问题