HTML Advanced Tags (3) ———— application of the form

Source: Internet
Author: User


In HTML development, there are many types and quantities of tags, and it is impossible to say that every one of them is thoroughly researched. There are a lot of tags that can be controlled with CSS, and we don't need to waste time on them. So, we just have to master in the HTML development of the more commonly used tags can be completely.

First, write one of the simplest login forms.

Application of 
<span style= "White-space:pre" ></span><tr>
<span style= "White-space:pre" ></span><td colspan= "2" align= "Center" >
<span style= "White-space:pre" ></span><input type= "Submit" Name= "Sub" >
<span style= "White-space:pre" ></span><input type= "reset" >
<span style= "White-space:pre" ></span><input type= "image" Src= "ucai.png" ><span style= " White-space:pre "></span><!--This is a photo that adds a relative path--
<span style= "White-space:pre" ></span></td>
<span style= "White-space:pre" ></span></tr>
<span style= "White-space:pre" ></span></form>
<span style= "White-space:pre" ></span></table>
<span style= "White-space:pre" ></span></body>
This is the result of the program running: (Image is just a logo I randomly intercepted, not advertising)


A simple form is done, note that the <form> tag should be placed in <table> and should be followed when adding other field elements.


Next, add a radio box and a check box.

<tr><th> check box </th><td>game<input type= "checkbox" >movie<input type= "checkbox" > Travel<input type= "checkbox" >reading<input type= "checkbox" >writing<input type= "checkbox" ></ td></tr><tr><th> Radio Box </th><td><input type= "Radio" name= "Sex" checked>boy< Input type= "Radio" name= "Sex" >girl<input type= "Radio" name= "Sex" >secret</td></tr>
check box type= "checkbox", type= "Radio" of the Radio box.

However, the check box can be selected as a whole or not. The radio box must have a selection, so add a default item, and a checked is added later. Also, the options in the radio box exist in mutually exclusive ways, and all of them are equal to the same in an array, that is, the name is the same, you can guarantee their mutual exclusion. Otherwise, you can't choose one.

This is the result after the run:



There must be a list in the form, and here are a few more common lists: normal list, drop-down list, multi-select list.

<th> drop-down list </th><td><select name= "list" ><option>--Please select--</option><option> 111111</option><option selected>222222</option><span style= "White-space:pre" ></span ><!--Default Options--><option>333333</option><option>444444</option><option> 555555</option><option>666666</option><option>777777</option><option> 888888</option></select></td></tr><tr><th> General List </th><td>< Select Name= "List1" size= "4" ><span style= "White-space:pre" ></span><!--drop-down length is 4--><option >--Please select--</option><option>111111</option><option>222222</option><option> 333333</option><option>444444</option><option>555555</option><option> 666666</option><option>777777</option><option>888888</option></select>< /td></tr><tr><th> Multi-select list </th><td><select name= "List2" Multiple><span style= "White-space:pre" ></ span><!--Multiple is represented as a multi-select list--><option>--Please select--</option><option>111111</option> <option>222222</option><option>333333</option><option>444444</option>< option>555555</option><option>666666</option><option>777777</option>< Option>888888</option></select></td></tr>


Don't confuse the internal and external relationships of labels.

Operation Result:

Finally, write a multi-line text field. Multi-line text fields are useful in many places that need to be described.

<tr><th> multiline Text field </th><td><textarea cols= "rows=" name= "message" >typing your Message here</textarea></td></tr>
It is very simple, a <testarea></textarea> is done. The cols and rows properties are not much to say.

Look at the post-run look:

Scroll bars are added automatically when the number of words exceeds the size of the text box.

Well, commonly used is these, everyone together to learn progress.


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.