Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the color of "placeholder" text?

Tags:

html

css

colors

Is that possible to set the color of placeholder text ?

<textarea placeholder="Write your message here..."></textarea> 
like image 508
Misha Moroshko Avatar asked Apr 30 '11 03:04

Misha Moroshko


People also ask

What color should placeholder text be?

Note: In most browsers, the appearance of placeholder text is a translucent or light gray color by default.

How do I change the placeholder text?

The “placeholder” property is used to get or set the placeholder of an input text. This can be used to change the placeholder text to a new one. The element is first selected using a jQuery selector. The new placeholder text can then be assigned to the element's placeholder property.

How do I change placeholder text in CSS?

Change Input Placeholder Text with CSS You can use the ::placeholder pseudo-element to change the styles of the placeholder text, which includes the ability to change the background. The code in this example uses a Sass function to generate code for support in older browsers as well.

How do I inspect the placeholder color?

Check the "Show user agent shadow DOM" checkbox and reload your page. You should now see the placeholder html output in your dev tools when you view the elements tab. Clicking on the placeholder html will bring up the applied styles for you to view or edit.


1 Answers

::-webkit-input-placeholder { /* WebKit browsers */     color:    #999; } :-moz-placeholder { /* Mozilla Firefox 4 to 18 */     color:    #999; } ::-moz-placeholder { /* Mozilla Firefox 19+ */     color:    #999; } :-ms-input-placeholder { /* Internet Explorer 10+ */     color:    #999; } 
like image 54
HasanAboShally Avatar answered Sep 21 '22 23:09

HasanAboShally