Chrome supports the placeholder attribute on input[type=text]
elements (others probably do too).
But the following CSS
doesn\'t do anything
For SASS/SCSS user using Bourbon, it has a built-in function.
//main.scss
@import 'bourbon';
input {
width: 300px;
@include placeholder {
color: red;
}
}
CSS Output, you can also grab this portion and paste into your code.
//main.css
input {
width: 300px;
}
input::-webkit-input-placeholder {
color: red;
}
input:-moz-placeholder {
color: red;
}
input::-moz-placeholder {
color: red;
}
input:-ms-input-placeholder {
color: red;
}