The use of textarea in html and common problems and case analysis

The use of textarea in html and common problems and case analysis
The textarea tag is an HTML tag that we often use. It is mainly used to achieve line breaks when inputting longer texts. Here is a basic usage of it:
textarea tag - represents a multi-line input field in an HTML form
The textarea tag appears in pairs, starting with <textarea> and ending with </textarea>
property :
Common -- General properties
cols -- the number of columns for a multi-line input field
rows -- the number of rows for a multi-line input field
accesskey -- shortcut key access method for the form
disabled -- The input field cannot receive focus, cannot be selected, is displayed in gray, and has no effect in the form
readonly -- The input field can be selected but cannot be modified
tabindex -- input fields, traversal order using the "tab" key
Use cases are as follows :
Html code:

Copy code
The code is as follows:

<form id="textareaDem" action="#" method="post">
<textarea cols="50" rows="10" id="contactus" name="contactus">Labels on one line</textarea>
</form>

You can copy the code to your local computer and test it.
The problem is, if these two <textarea></textarea> are not on the same line, for example, the effect will be different if they are written in separate lines.

Copy code
The code is as follows:

<form id="textareaDemo" action="#" method="post">
<textarea>
This is the textarea tag is not on a line by line, the effect will be different
</textarea>
</form>

You will find that the first code is displayed left-aligned, while the next one is displayed in the center. Therefore, when using textarea, you must pay attention that the text in the textarea tag is relative to the textarea. The textarea is equivalent to providing an editing area, which starts immediately after the textarea, that is, what you see is what you get. As long as these two tags are not in the same line, the space before </textarea> will also be recognized as blank text, and you will find that your mouse editing pointer will not flash at the beginning of the text or next to the text. So make good use of this tag so that you know where to start solving problems when you encounter them.

It's a bit confusing, but you should be able to understand it after a little experiment. Hehe0_*

<<:  Teach you to create custom hooks in react

>>:  Incredible CSS navigation bar underline following effect

Recommend

Example code for Html layered box-shadow effect

First, let’s take a look at the picture: Today we...

How to clean up data in MySQL online database

Table of contents 01 Scenario Analysis 02 Operati...

Explain how to analyze SQL efficiency

The Explain command is the first recommended comm...

Summary of Seven Basic XHTML Coding Rules

1. All tags must have a corresponding end tag Prev...

Summary of the differences between count(*), count(1) and count(col) in MySQL

Preface The count function is used to count the r...

Example of how nginx implements dynamic and static separation

Table of contents Deploy nginx on server1 Deploy ...

ie filter collection

IE gave us a headache in the early stages of deve...

Example code for using HTML ul and li tags to display images

Copy the following code to the code area of ​​Drea...

Node.js+express+socket realizes online real-time multi-person chat room

This article shares the specific code of Node.js+...

Introduction to NFS service construction under Centos7

Table of contents 1. Server 2. Client 3. Testing ...

Q&A: Differences between XML and HTML

Q: I don’t know what is the difference between xml...

Play and save WeChat public account recording files (convert amr files to mp3)

Table of contents Audio transcoding tools princip...