Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 Form Text Placeholders - Do they have a CSS pseudo-class?

Reading an article about HTML5, it occurs to me that while placeholders are incredibly useful in form usability, if they can not be targeted with CSS without javascript, they really are a baby step.

So can I target the placeholder in CSS to look differently from inputted text?

like image 394
Mild Fuzz Avatar asked Feb 01 '11 14:02

Mild Fuzz


1 Answers

Webkit uses a ::-webkit-input-placeholder pseudoelement. Moz uses a :-moz-placeholder pseudoclass.

like image 166
Lea Verou Avatar answered Nov 15 '22 08:11

Lea Verou