Home  >  Article  >  Web Front-end  >  Detailed introduction to HTML CSS FORM

Detailed introduction to HTML CSS FORM

高洛峰
高洛峰Original
2017-03-27 09:55:471721browse

Forms are often used to collect input from different types of users, allowing users to collect: text fields (text), drop-down lists (select), radio buttons (radio), check boxes (checkbox) and action buttons (Action)

Form tag

HTML CSS之FORM的详细介绍

Most form tags are input tags, and the input type is defined by (type).

example: & lt; form & gt;

# & lt; input Type = "Text" name = "first_text" & gt;

## & ltpe = 'Text' name="address" value="Guangdong"> When a default value is required, use the value attribute


                                                                                                                                                                                                                                                                     

                                                                                                                                                                                "checkbox" name="Tiger">

                                                                                                                                                                                                                     ​ Select

The elements used in the drop-down list are: select The attribute is: option

Example:

221f08282418e2996498697df914ce4e

value="dongfong">Dongfong4afa15d3069109ac30911f04c56f3338

60e3e4156f93360140eccdbe9fc2b955Ji Rui4afa15d3069109ac30911f04c56f3338 selected is the default selection attribute f75ab043b42ec491d9b7abc33f5d3d27Geely4afa15d3069109ac30911f04c56f3338

                                                                         Example shows how to draw a box with a title around the data.

ff9c23ada1bcecdd1a0fb5d5a0f18437

2b5469ab79cf842344327415c3b3bb95

e911751791aa3ba95dc724e2fb905976Health Informationa814477f903c8e27bd1ff8e5c6bbe7c1

HTML CSS之FORM的详细介绍 Height: c5b5b4350adc193d659abbcb630e24d8

Measurements: 22e1bb649e3e439c82b64204a5f95e3f

a3ae74428855f48d0438405a4619fe75

f5a47148e367a6035fd7a2faa965022e

Button Three attributes of the button

submit This button is a submit button (except for Internet Explorer, this value is the default value of other browsers).

button This button is a clickable button (the default for Internet Explorer).

reset This button is a reset button (clear form data).

<form action="form_action.asp" method="get">
  First name: <input type="text" name="fname" />
  Last name: <input type="text" name="lname" />
  
  <button type="submit" value="Submit">Submit</button>
  <button type="reset" value="Reset">Reset</button>
</form>

The above is the detailed content of Detailed introduction to HTML CSS FORM. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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