EN
CSS - style input placeholder text
0
points
In this article, we would like to show you how to style input's placeholder text using CSS.
Quick solution:
input::placeholder {
font-style: italic;
opacity: 0.5;
color: red;
}
Practical example
In this example, we present how to use ::placeholder pseudo-element to style input's placeholder text.
// ONLINE-RUNNER:browser;
<!doctype html>
<html>
<head>
<style>
input::placeholder {
font-style: italic;
opacity: 0.5;
color: red;
}
</style>
</head>
<body>
<input type="text" placeholder="Placeholder text...">
</body>
</html>