输入类型搜索-如何获取白色占位符和清除按钮?

时间:2019-06-27 03:33:01

标签: html css input

在下面的示例中,如何获得白色的placeholderclear button-

谢谢。

.searcha{
  display:block;
  width:100%;
  padding:3px 9px;
  text-transform:uppercase;
  font-size:1rem;
  letter-spacing:0.5px;
  background:#006790;
  border:none;
  outline:none;
  color:white;
}
<input type='search' class='searcha' placeholder='&#x1F50D;'>

1 个答案:

答案 0 :(得分:1)

尝试一下

.searcha {
  display: block;
  width: 100%;
  padding: 3px 9px;
  text-transform: uppercase;
  font-size: 1rem;
  letter-spacing: 0.5px;
  background: #006790;
  border: none;
  outline: none;
  color: white;
}

::-webkit-input-placeholder {
  color: white;
}
<input type='search' class='searcha' placeholder='&#x1F50D; Placeholder'>