CSS styling placeholder text
问题 I am trying to style placeholder text, but I can't seem to select it. If my input is this: <input id="search" class="search-query" placeholder="Placeholder text here" name="" value""> How can I select the placeholder text in css for styling? 回答1: ::-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 {