About the placeholder style setting problem of input, compatible with a variety of browsers

Source: Internet
Author: User

The font color of the general placeholder is lighter than the value of the input value, so we use the

:-webkit-input-placeholder,
:-moz-placeholder,
:-ms-input-placeholder, these pseudo-class elements.

The value on input on Safiri was found using a browser-defined font style, rather than the Arial font I originally set, the heart plug.

Note that this is not about Plaholder.

-o-.....

as follows, the placeholder and value of input are the desired font styles,

The font style on the button is written directly on the input. There's nothing more to say.

Input::-webkit-input-placeholder,
input{
Font-family:arial, Helvetica, Sans-serif;
}
Input:-moz-placeholder,
input{
Font-family:arial, Helvetica, Sans-serif;
}
Input:-ms-input-placeholder,
input{
Font-family:arial, Helvetica, Sans-serif;
}


--------------------------------------------------------

Finally, the discovery of a dog's blood was useless.

And then I tried so many times I thought it was useless.

The Real code:

::-webkit-input-placeholder{color: #f72109;}
::-moz-placeholder{color: #f72109;}
:-ms-placeholder{color: #f72109;}

. XX::-webkit-input-placeholder{color: #f72109;}
. XX::-moz-placeholder{color: #f72109;}
. XX:-ms-placeholder{color: #f72109;}

. xx is the class name


Or

Input:-webkit-autofill,textarea:-webkit-autofill,select:-webkit-autofill {
Box-shadow:inset 0 0 0 1000px #fff;
-moz-box-shadow:inset 0 0 0 1000px #fff;
/*-webkit-box-shadow:inset 0 0 0 1000px #fff; */
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.