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
Table of contents Problem Description Solution Pr...
I don’t know if you have ever encountered such a ...
Preface When we write web pages, we will definite...
Table of contents 1. Quickly recognize the concep...
Table of contents Chain calls A small case Chain ...
Result: Implementation Code html <div id="...
This article introduces the sample code of CSS3 c...
Table of contents 1. Cause 2. Equipment Informati...
Table of contents Technology Stack Effect analyze...
vue+element UI encapsulates a public function to ...
For individual webmasters, how to make their websi...
Download CentOS7 The image I downloaded is CentOS...
IE gave us a headache in the early stages of deve...
1. Change password 1. Modify the password of ordi...
Preface: Because many business tables use design ...