HTML5 input placeholder placeholder entry box hint text

Source: Internet
Author: User

HTML5 adds new properties to the input box, such as placehoLder (Placeholder), which indicates that some text is pre-placed in the text box. Placeholders are sample content that the text box can accept, and the general color is gray. As soon as one stone hits the text box, he disappears. If you delete all the entries you have entered, and then stand outside the text box, it will appear again. Try JavaScript, of course, to achieve this. But HTML5 solves the problem with only one placeholder attribute.

<!DOCTYPE HTML><HTMLLang= "en"><Head><MetaCharSet= "UTF-8"><title>Document</title><style>Body{padding:100px;}input{Display:Block;width:300px;Height:30px;Line-height:30px;Outline:None;text-indent:10px;Margin-bottom:10px;}</style></Head><Body>    <inputtype= "text"placeholder= "Here is the hint text, placeholder, you can enter" white bug ">     <input  type= "text"   placeholder= "Here is the hint text, placeholder"  > </Body></HTML>

As shown in the following:

HTML5 input placeholder placeholder entry box hint text

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.