The content of the commonly used input text box is automatically vertically centered and the default prompt text is empty when clicked

The content of the commonly used input text box is automatically vertically centered and the default prompt text is empty when clicked
Three functions:

1. Automatic vertical centering of content
2. The default prompt text is displayed in gray
3. Click to become empty

Copy code
The code is as follows:

<input type="text" name="wd1" id="qy_1" maxlength="100" style="color:gray;width:199px;height:30px;line-height:30px;" autocomplete="off" value="Please enter the company name" style="color:gray;" onfocus="javascript:if(this.value == 'Please enter the company name') this.value = ''; this.style.color='gray';" onblur="if(this.value == '') {this.value = 'Please enter the company name'; this.style.color = 'gray';}">

<<:  Pure CSS to achieve the text description of semi-transparent effect when the mouse is placed on it (must read for novices)

>>:  How to query data from multiple unrelated tables and paging in Mysql

Blog    

Recommend

CSS method of clearing float and BFC

BFC BFC: Block Formatting Context BFC layout rule...

A complete guide to some uncommon but useful CSS attribute operations

1. Custom text selection ::selection { background...

The difference between br and br/ in HTML

answer from stackflow: Simply <br> is suffic...

Shell script to monitor MySQL master-slave status

Share a Shell script under Linux to monitor the m...

Example analysis of the impact of MySQL index on sorting

This article uses examples to illustrate the impa...

How to display and format json data on html page

JSON data is displayed and formatted on the HTML ...

How to restore single table data using MySQL full database backup data

Preface When backing up the database, a full data...

Does the website's text still need to be designed?

Many people may ask, does the text on the website...

How to manually upgrade the kernel in deepin linux

deepin and Ubuntu are both distributions based on...

How to store images in MySQL

1 Introduction When designing a database, it is i...

How to use Docker to package and deploy images locally

First time using docker to package and deploy ima...