HTML&CSS Basic Learning Note 1.23-text fields and drop-down lists for forms

Source: Internet
Author: User

Text field

<textarea> tags define multiple lines of text input controls.

Usually on the Web page some need to input more content input box, such as reply to the post, answer questions, etc., can be used <textarea> tags.

The <textarea> text area can hold an unlimited number of text, and you can specify the size of <textarea> by using [cols] and [rows] properties.

For example:

< textarea < Span class= "Hljs-tag" >cols= " rows= "6" > </textarea< Span class= "Hljs-tag" >>&NBSP;&NBSP;            

Represents a text field with a size of 100 columns and 6 rows.

Instance:

<!DOCTYPE HTML>  <HTMLLang= "en">  <Head>      <MetaCharSet= "UTF-8">      <Linkrel= "stylesheet"type= "Text/css"href= "Index.css">      <title>Form</title>  </Head>  <Body>  <H1>Using in forms<textarea>Label</H1>      <formAction="/"Method= "Get">          <H2>Personal profile</H2>          <textareacols= "Ten"rows= "5"Maxcols= " the"MaxRows= "Ten">          </textarea>      </form>  </Body>  </HTML>  

drop-down list

Drop-down lists are also common in forms, such as when selecting a province or city and using a drop-down list.

The <select> tab creates a drop-down menu with a single or multiple selection.
The <option> label represents the list item for the drop-down list. The <option> tag can be used without any attributes, but you usually need to use the [value] property, which indicates what is sent to the background.
<select> tags are used with <option> tags:

<Select>      <optionvalue= "0">Please select</option>      <optionvalue= "1">Option A</option>      <optionvalue= "2">Option B</option>  </Select>  

Instance:

<!DOCTYPE HTML>  <HTMLLang= "en">  <Head>      <MetaCharSet= "UTF-8">      <Linkrel= "stylesheet"type= "Text/css"href= "Index.css">      <title>Form</title>  </Head>  <Body>  <H1>Using in forms<Select>Label</H1>  <formAction="/"Method= "Get">      <H2>drop-down list</H2>      <P>you are studying:<Select>              <optionvalue= "html">Html</option>              <optionvalue= "CSS">Css</option>              <!--Add a list item here -              <optionvalue= "SSS">Sss</option>          </Select>      </P>  </form>  </Body>  </HTML>  

more learning content, just in the code bud Net Http://www.mayacoder.com/lesson/index

HTML&CSS Basic Learning Note 1.23-text fields and drop-down lists for forms

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.