This time I will bring you the content of commonly used input text boxes that are automatically vertically centered and the default prompt text is empty when clicked. What are the precautions for the content of commonly used input text boxes that are automatically vertically centered and the default prompt text is empty when clicked? The following are Let’s take a look at practical cases.
This effect has three functions:
1. The content is automatically vertically centered
2. The default prompt text is gray
3. It becomes empty after clicking
<input type="text" name="wd1" id="qy_1" maxlength="100" style="color:gray;width:199px;height:30px;line-height:30px;" autocomplete="off" value="请输入企业名称" style="color:gray;" onfocus="javascript:if(this.value == '请输入企业名称') this.value = ''; this.style.color='gray';" onblur="if(this.value == '') {this.value = '请输入企业名称'; this.style.color = 'gray';}">
I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to other related articles on the php Chinese website!
Related reading:
What are the differences between inline elements and block-level elements in html
What are the symbols that mark text comments in Html
The above is the detailed content of The content of the commonly used input text box is automatically vertically centered and the default prompt text is empty when clicked.. For more information, please follow other related articles on the PHP Chinese website!