Muted empty fields
input:placeholder-shown {
border-color: #94a3b8;
background: #f8fafc;
}
The :placeholder-shown pseudo-class matches an input or textarea while it is empty and showing placeholder text. Use it to style empty fields differently from filled ones.
input:placeholder-shown {
border-color: #94a3b8;
}input:placeholder-shown {
border-color: #94a3b8;
background: #f8fafc;
}input:not(:placeholder-shown) {
border-color: #16a34a;
}:placeholder-shown is a CSS selector.
Supported in modern browsers.
Bottom line: Safe for modern sites. Keep readable defaults without the selector.
Continue with :autofill.
CODETOFUN NEWS
Get the latest IT news, programming updates, and technology trends directly on your phone.
Your daily dose of tech, straight to your feed.
2 people found this page helpful