How to modify CSS styles for placeholder fonts

Source: Internet
Author: User

Modify CSS styles for text within Palceholder

1 ::-webkit-input-placeholder {2    color: red;  3    font-size: 20px;  4    line-height: 50px;  5 }

Modify the Palceholder text CSS style in class named Test1

. Test1::-webkit-input-placeholder {    color: red;     font-size: 20px;     line-height: 50px;}

Example:

<!DOCTYPE HTML><HTML>    <Head>        <MetaCharSet= "UTF-8">        <title></title>        <style>input{Height:50px;font-size:14px;Line-height:50px;            }. Test1::-webkit-input-placeholder{Color:Red;font-size:20px;Line-height:50px;            }                    </style>    </Head>    <Body>        <inputclass= "Test1"type= "text"placeholder= "Test" />        <inputtype= "text"placeholder= "Test" />    </Body></HTML>

As for compatibility, add the corresponding browser prefix

How to modify CSS styles for placeholder fonts

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.