::placeholder
W3C CSS Snapshot 2026
Style the hint text in an empty input or textarea.
On this page
Syntax and values
| Value or syntax | What it does |
|---|---|
input::placeholder | Styles the placeholder text. Use a separate label to name the field. |
Try the example
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>::placeholder</title>
<style>
input::placeholder { color: #285e65; font-style: italic; }
</style>
</head>
<body>
<label>City <input placeholder="e.g., Yangon"></label>
</body>
</html>
What to expect The hint is italic. Type a city and the placeholder disappears.