是否可以设置html表单输入文本框的选择颜色?

时间:2015-04-08 15:11:39

标签: html css input

我希望能够在用户选择时指定input文本框周围显示的突出显示颜色。默认情况下(在Mac上),根据下面的屏幕截图,这似乎总是浅蓝色。

有没有人知道这是否可行,如果可能,怎么办?

未选定的:

enter image description here

选择的:

enter image description here

1 个答案:

答案 0 :(得分:3)

使用

input:focus {
  border:/** your style definitions **/
  outline: /** **/
  box-shadow: /** **/
}