I have a textarea
with an attribute placeholder="tu comentario"
. I would like to change the color of said text but I don't know how to reference it in the style sheet.
I have a textarea
with an attribute placeholder="tu comentario"
. I would like to change the color of said text but I don't know how to reference it in the style sheet.
I refer to this interesting article published in CSS Tricks , where your case is analyzed in depth:
The pseudo-element
::placeholder
(or a pseudo-class, in some cases, depending on the browser implementation) allows you to apply a style to the placeholder text of a form element.You can style that text in most browsers with this selection of vendor-prefixed selectors:
Like any psuedo, you can include specific elements as needed, for example if you want different colors depending on the element type, class, etc:
try this