::-webkit-input-placeholder { /* Safari, Chrome and Opera */
color: red;
transition: .3s;
}
:-moz-placeholder { /* Firefox 18- */
color: red;
transition: .3s;
}
::-moz-placeholder { /* Firefox 19+ */
color: red;
transition: .3s;
}
:-ms-input-placeholder { /* IE 10+ */
color: red;
transition: .3s;
}
::-ms-input-placeholder { /* Edge */
color: red;
transition: .3s;
}
:focus::-webkit-input-placeholder { color: transparent }
:focus:-moz-placeholder { color: transparent }
:focus::-moz-placeholder { color: transparent }
:focus:-ms-input-placeholder { color: transparent }
:focus::-ms-input-placeholder { color: transparent }
In CSS4 we will get a standard property for this - :placeholder-shown - but until then we need these 5 vendor prefixed versions to do the job.
Also please note. You can't combine them in a single CSS block, they have to be separate!
Also please note. You can't combine them in a single CSS block, they have to be separate!
5 Responses
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/3901363/
Write a comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.