Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS styling placeholder text

Tags:

html

css

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?

like image 461
user1995822 Avatar asked Apr 22 '26 05:04

user1995822


1 Answers

::-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 }

Demo: http://jsfiddle.net/DLGFK/

like image 132
AlienWebguy Avatar answered Apr 24 '26 18:04

AlienWebguy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!