HTML form basic formatting and code

Source: Internet
Author: User

Let's first look at what we need to learn today, it is easy to understand, like my English is not good just need to recite a few words

The most basic code and format needed to create a form in HTML

1 <formMethod= "Post/get" >2 <!--text Input -3 <inputtype= "text" />    <!--text Box -4 <inputtype= "Password" />    <!--Password Box -5 <inputtype= "hidden" />    <!--Hidden Fields -6 <textarea></textarea>    <!--text Field -7 <!--button Input -8 <inputtype= "Submit" />    <!--Submit Button -9 <inputtype= "button/> <!--normal button --Ten <input type= "image "/>    <!--Picture Button - One <inputtype= "Reset" />    <!--Reset button - A <!--Select Input - - <inputtype= "Redio"name=""checked= "Checked"value="" />    <!--name is used for grouping, checked is the default value, and value is the name of the named button - - <inputtype= "checkbox"name=""checked= "Checked"value=""/>    <!--check or multi-select - the <inputtype= "File" />    <!--Upload Image - - <Select>    <!--Drop- down menu - - <optionvalue= "value">Content</option> - <optionvalue= "value">Content</option> + <optionvalue= "value">Content</option> - <optionvalue= "value">Content</option> + </Select> A </form>

That's what we need to remember.

It looks complicated, it's troublesome.

Let's take a look at the idea.

The total is divided into three categories, each class is divided into four kinds, throw textarea\select the rest is input tpye= this style begins

The text class is the following four

Input type= "text"

........... password

........... hidden

<textarea><textarea/>

of the Button class

Input type= "Submit"

... a button that is a.....

.......... reset

.......... image

Select input

Input type= "Redio"

... the checkbox of A. ..... checkboxes.

............ file

<select><option></option></select>

Finally, let's add a little content, about selecting classes and button classes for the complex

We are on some websites to register the account, we choose options such as male, female, not necessarily to click the button to be able to click on the Chinese character can also choose, that this little trick is what, we look down

<lable for= "id" > button content </lable>

 1  <  input  type  = "Redio"   name  = ""   checked  = "checked"   value  = "male"   ID  = "001"  />  2  <   lable  for  = "001"  >  male </ lable  >  

So let's go to click the Front button can also, click on the word "male" can also choose, save the mouse, touchpad use a lot of unnecessary trouble

HTML form basic formatting and code

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.