{"id":236285,"date":"2016-01-06T09:09:15","date_gmt":"2016-01-06T16:09:15","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=236285"},"modified":"2020-05-22T15:21:45","modified_gmt":"2020-05-22T22:21:45","slug":"placeholder-shown","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/selectors\/p\/placeholder-shown\/","title":{"rendered":":placeholder-shown"},"content":{"rendered":"\n

The :placeholder-shown<\/code> pseudo-class selects the input element itself<\/strong> when placeholder text exists in a form input. Think of it as a nice way to distinguish between inputs that are currently showing placeholder text<\/em> versus those that are not.<\/p>\n\n\n\n

input:placeholder-shown {\n  border: 5px solid red;\n}<\/code><\/pre>\n\n\n\n