EN
CSS - style textarea placeholder text
0 points
In this article, we would like to show you how to style textarea placeholder text using CSS.
Quick solution:
xxxxxxxxxx
1
textarea::placeholder {
2
font-style: italic;
3
opacity: 0.5;
4
color: red;
5
}
In this example, we present how to use ::placeholder
pseudo-element to style textarea placeholder text.
xxxxxxxxxx
1
2
<html>
3
<head>
4
<style>
5
6
textarea::placeholder {
7
font-style: italic;
8
opacity: 0.5;
9
color: red;
10
}
11
12
</style>
13
</head>
14
<body>
15
<textarea placeholder="Placeholder text..."></textarea>
16
</body>
17
</html>