Some parameters of the text input box in web design

Source: Internet
Author: User
Tags border color

In the general message, forums and other places to use the text input box, that is, HTML language textarea,textare contains a large number of parameters, learn to use these parameters, you can change the size and appearance of text input box, to achieve the effect you want, the following to introduce these parameters, And how to use these parameters.

1, cols, vertical column. In the absence of a style sheet setting, it represents the number of bytes that can be accommodated in a row. Cols=60, for example, indicates that a line can hold up to 60 bytes, or 30 characters. Also note that the width of the text box is adjusted by this, enter a good cols value, and then define the size of the input text font (not defined, the default value), then the width of the text box is determined.

2, rows, horizontal column. Represents the number of rows that can be displayed, such as rows=10, which indicates that 10 rows can be displayed. More than 10 rows, you need to drag the scroll bar to browse. (ditto, the height of the text box is controlled by this.) )

3, name, the names of the text boxes, this will not be saved, because the time to store text must be used.

4, Warp, when warp= "off" means that the text area does not automatically wrap, of course, do not write the default is automatic line wrapping. This parameter is generally used relatively little.

5, style, this is a very useful parameter, can be used to set the background color of the text box, scroll bar color and form, border color, enter the size of the font color and so on.

6, class, generally used to call the external CSS inside the settings.

Example 1: Set the number of rows in the text box to 40, and the number of columns to 10. The name is text. Expression Form <textarea cols=40 rows=10 name=text></textarea>

Example 2: Suppresses the scroll bar to the right of the text box. The expression forms <textarea cols=40 rows=10 name=text style= "Overflow:auto" ></textarea>. style= "Overflow:auto" means that scroll bars are automatically displayed when the text you enter exceeds the number of lines you set.

Example 3: Sets the background color of the text box. <textarea cols=40 rows=10 name=text style= "Background-color:bfcedc" ></textarea>.

Example 4: Set the scroll bar color of the text box, border color, and font size, color, line spacing, etc., can be set directly in the style. However, these are generally used in CSS settings, direct call is good. The following is a section of CSS Settings code: It should be easier to understand, the textbox is set in turn is the background color of the text box, up and down the border color and thickness, as well as the size of the input font.

<style>
. textbox {BACKGROUND: #BFCEDC; Border-top: #7F9DB9 1px solid; Border-left: #7F9DB9 1px solid; Border-right: #7F9DB9 1px solid; Border-bottom: #7F9DB9 1px solid; font-family: "Song Body", "Verdana", "Arial", "Helvetica"; font-size:12px; Text-align:lift;}
</style>


Insert the above section of code into the page between

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.