Style difference :firefox x Chrome

Asked

Viewed 44 times

0

I have the following CSS

::-webkit-input-placeholder, 
:-moz-placeholder, 
::-moz-placeholder, 
:-ms-input-placeholder {
 color: rgb(150,150,150);
}

::-webkit-input-placeholder:hover, 
:-moz-placeholder:hover,  
::-moz-placeholder:hover, 
:-ms-input-placeholder:hover {
 color: rgb(255,255,255);
}

The

::-webkit-input-placeholder, 
:-moz-placeholder, 
::-moz-placeholder, 
:-ms-input-placeholder {
 color: rgb(150,150,150);
}

works in all browsers I tested, but the

::-webkit-input-placeholder:hover, 
:-moz-placeholder:hover,  
::-moz-placeholder:hover, 
:-ms-input-placeholder:hover {
 color: rgb(255,255,255);
}

Only works on firefox.

Where is the error?

Note: I have tried with :phocus, didn’t work either

1 answer

1

Here works with Focus

:focus::-webkit-input-placeholder { color: #ff0000; };
:focus:-moz-placeholder { color: #ff0000; };
<input type="text" placeholder="texto placeholder"/>

  • The problem is that I was making one line under the other. So it didn’t work. When I put them all under the same line it worked.

  • @Carlosrocha ops, I don’t understand.

  • :Focus::-Webkit-input-placeholder, :Focus:-Moz-placeholder {..}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.