我正在尝试设置占位符文本,但我似乎无法选择它.如果我的输入是这样的:
<input id="search" class="search-query" placeholder="Placeholder text here" name="" value"">
Run Code Online (Sandbox Code Playgroud)
如何在css中选择占位符文本进行样式设置?
Ali*_*guy 15
::-webkit-input-placeholder {
color: red;
}
:-moz-placeholder { /* Firefox 18- */
color: red;
}
::-moz-placeholder { /* Firefox 19+ */
color: red;
}
:-ms-input-placeholder {
color: red;
}
/* All modern browsers except IE and EDGE */
::placeholder { color: red }
Run Code Online (Sandbox Code Playgroud)