pseudo-class

:blank (input) — CSS reference

Draft empty-value selector for user-input elements; distinct from the paged-media :blank selector. Text controls with an empty value qualify; unchecked checkboxes are also covered by the proposal. Placeholder-shown is only a fallback for text controls displaying a placeholder, not a universal equivalent.

Formal Syntax & Structure

css syntaxcss
input:blank

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>:blank (input)</title><style>body{margin:0;background:white}#a{box-sizing:border-box}input{border:2px solid blue}input:placeholder-shown{border-color:red}input:blank{border-color:red}</style><body><label for="a">Name</label><input id="a" placeholder="Name"><label for="b">City</label><input id="b" value="Baku" placeholder="City"></body></html>
CSS Reference