Webkit CSS to control the box around the color in an input[type=color]?

后端 未结 11 2034
天涯浪人
天涯浪人 2020-11-28 06:29

Is there a Webkit-specific CSS style that will allow me to control the color/size/style of the box around the color in an input[type=color]?

I\'m setting

11条回答
  •  無奈伤痛
    2020-11-28 07:16

    This is how I did it for a art project recently. I am a newbie, so let me know if I did this horribly wrong.

    input[type=color]{
    	width: 40px;
    	height: 40px;
    	border: none;
    	border-radius: 40px;
    	background: none;
    }
    input[type="color"]::-webkit-color-swatch-wrapper {
    	padding: 0;
    }
    input[type="color"]::-webkit-color-swatch {
    	border: solid 1px #000; /*change color of the swatch border here*/
    	border-radius: 40px;
    }

提交回复
热议问题