Placeholder style settings, placeholder Style

Source: Internet
Author: User

Placeholder style settings, placeholder Style

In the input box, if you want to set the entered word and placeholder to different colors or other effects, you can use the following code to set the style of placeholder.

:-Webkit-input-placeholder {}/* browser using the webkit kernel */:-moz-placeholder {}/* Firefox version 4-18 */:: -moz-placeholder {}/* Firefox version 19 + */:-ms-input-placeholder {}/* IE browser */Note 1: write the corresponding input or textarea elements before the colon. Note 2: The placeholder attribute is a newly added attribute in css3. CSS selectors of IE9 and Opera12 do not support placeholder text. Eg: css Code # input-test {color: # FFC0CB; font-size: 1.2em; width: 180px; height: 36px;} # input-test :: -webkit-input-placeholder {color: # ADD8E6;} # input-text:-moz-placeholder {// I don't know why Firefox's placeholder is pink, I don't know how to change it. I hope Daniel will pass by and help me with color: # ADD8E6;} # input-text:-ms-input-placeholder {// because my IE is IE9, placeholder is not supported, so it cannot be tested. If you have more than IE10, try color: # ADD8E6 ;} html code <div id = "container"> <input id = "input-test" ty Pe = "text" placeholder = "Modify placeholder style"/> </div> shows the effect: PS: You can also modify the font-weight style of placeholder. Eg: I added "font-weight: bold;", as shown in:

Related Article

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.