I recently used the input size and maxlength attributes in a project. In the past, I just used them without paying attention to the difference between these two tags. I searched on Baidu today and got some understanding. Specially recorded here! Copy code The code is as follows:<p>Name: <input type="text" name="fullname" maxlength="5" /></p> <p>Name2: <input type="text" name="fullname" size="5" /></p> maxlength="5", then only 5 characters can be entered in the input box<br/> size="5" means that the input box only displays 5 visible characters, but you can enter 'infinite' characters That is, the size attribute specifies the width of the input field (here, the Name2 text box only displays 5 characters). Since the size attribute is a visual design attribute, we should use width in CSS instead. CSS syntax: <input style="width:100px"/> |
<<: 4 solutions to CSS browser compatibility issues
>>: Detailed explanation of Vue project optimization and packaging
Error message: user: 'root' host: `localh...
As one of the most popular front-end frameworks, ...
Preface Tomcat is an excellent Java container, bu...
This article records the installation tutorial of...
Table of contents 1. Lock and Latch 2. Repeatable...
MySql Download 1. Open the official website and f...
Table of contents Preface Creation steps Create a...
Preface Golang provides the database/sql package ...
illustrate DML (Data Manipulation Language) refer...
Table of contents 1 Difference 1.1 Space Occupanc...
This article mainly introduces how to implement a...
This article shares the specific code of jQuery t...
A must-have for interviews, you will definitely u...
Check virtualization in Task Manager, if it is en...
Table of contents The first method: When the MySQ...