简体   繁体   English

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

[英]Is it possible to set the selection colour of html form input text box?

I want to be able to specify the highlight colour that appears around an input text box when a user selects it. 我希望能够指定用户选择input文本框周围时出现的突出显示颜色。 By default (on a Mac) this always seems to be a light blue colour as per the screenshots below. 默认情况下(在Mac上),根据下面的屏幕截图,这似乎总是淡蓝色。

Does anyone know if this is possible and if so how? 有人知道这是否可行吗?

Unselected: 未选择:

在此处输入图片说明

Selected: 已选:

在此处输入图片说明

use 采用

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM