Languages
[Edit]
EN

CSS - style textarea placeholder text

0 points
Created by:
Vanessa-Drake
718

In this article, we would like to show you how to style textarea placeholder text using CSS.

Quick solution:

textarea::placeholder {
    font-style: italic;
    opacity: 0.5;
    color: red;
}

 

Practical example

In this example, we present how to use ::placeholder pseudo-element to style textarea placeholder text.

// ONLINE-RUNNER:browser;

<!doctype html>
<html>
<head>
  <style>

    textarea::placeholder {
        font-style: italic;
        opacity: 0.5;
        color: red;
    }

  </style>
</head>
<body>
  <textarea placeholder="Placeholder text..."></textarea>
</body>
</html>

 

See also

  1. CSS - style textarea HTML element

  2. CSS - disable textarea resize button

  3. CSS - change textarea size

References

  1. ::placeholder - CSS: Cascading Style Sheets | MDN

Alternative titles

  1. CSS - style textarea HTML element placeholder text
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join