Home > Web Front-end > HTML Tutorial > The use of textarea in html, common problems and case analysis_HTML/Xhtml_Web page production

The use of textarea in html, common problems and case analysis_HTML/Xhtml_Web page production

WBOY
Release: 2016-05-16 16:40:35
Original
1852 people have browsed it

The textarea tag is an HTML tag that we often use, mainly to achieve line breaks and other effects when entering longer text. Here is a quote from its basic usage:
textarea tag - represents a multi-line input field in an HTML form
textarea tags appear in pairs, starting with
Attributes:
Common -- General attributes
cols -- The number of columns of the multi-line input field
rows -- The number of rows of the multi-line input field
accesskey -- The form's Shortcut key access method
disabled -- the input field cannot gain 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, the traversal order using the "tab" key
The use case is as follows:
Html code:

Copy code
The code is as follows:





on the label line can be copied to Test it locally.
The problem is, if the two are not on the same line, for example
Writing code on separate lines will have different effects

Copy code
The code is as follows:





You will find that: The first code is displayed left-aligned, while the next one will be displayed centered. So when using textarea, you must pay attention. The text in the textarea tag is relative to the textarea. The textarea is equivalent to providing an editing area. This area starts immediately after the textarea, which is the so-called WYSIWYG. As long as these two tags are not on the same line, the blank space before will also be recognized as blank text. You will find that your mouse editing pointer will not flash at the beginning of the text or next to the text. So use this label well and know where to start when you encounter problems.

It’s a bit confusing, you should be able to understand it after a little experimentation. Haha 0_*
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template