Review of the list of forms and HTML

FORM HTML form

  • Form a region comprising a form element.
  • Form element allowing user input in the form, for example: text fields (TextArea), drop-down lists, radio buttons (radio-buttons), box (checkboxes) and the like.
  • Form using the form tag <form> is set.
<form>

input 元素

</form>

How to create radio buttons in HTML?

<form action="">
<input type="radio" name="sex" value="man"><br>
<input type="radio" name="sex" value="woman"></form>

How to create check boxes and radio buttons in an HTML page?

<form action="">
<input type="checkbox" name="hobby" value="Football">足球<br>
<input type="checkbox" name="hobby" value="Music">音乐
</form>
<form action="demo-form.php" method="get">
  <input type="radio" name="sex" value="man"> Man<br>
  <input type="radio" name="sex" value="woman" checked="checked">Woman<br>
  <input type="submit" value="提交">
</form>

 

How to create a drop-down list box in an HTML page?

<form action="">
<select name="colors">
<option value="yellow">yellow</option>
<option value="red">red</option>
<option value="blue" selected>blue</option>
</select>
</form>

How to create a text field?

<form action="">
First name: <input type="text" name="FirstName" value="Mickey"><br>
Last name: <input type="text" name="LastName" value="Mouse"><br>
<input type="submit" value="提交">
</form>

How to send email from a form?

<form action="@qq.com" method="post" enctype="text/plain">
Name:<br>
<input type="text" name="name"><br>
E-mail:<br>
<input type="text" name="mail"><br>
Comment:<br>
<input type="text" name="comment"size="50"><br><br>
Password: <input type="password" name="pwd">
<input type="submit" value="发送"> <input type="reset" value="重置"> </form>

HTML  List

Ordered, unordered and definition lists

HTML ordered list

<ol>
<li>AAA</li>
<li>BBB</li>
</ol>

HTML unordered list

<ul>
<li>AAA</li>
<li>BBB</li>
</ul>
<ul>
  <li>AAA</li>
  <li>BBB
    <ul>
      <li>aaa</li>
      <li>aa
        <ul>
          <li>bbb</li>
          <li>bb</li>
        </ul>
      </li>
    </ul>
  </ >Li
  <li>CCC</li>
</ul>

 

In HTML 4 in ul property has been abandoned, HTML5 is not supported by the property, so we use CSS instead of to define different types of unordered list

HTML Custom List

A custom list starts with <dl> tag. Each custom list item starts with <dt>. Each custom defined list item begins with <dd>.

<dl>
<dt>AAA</dt>
<dd>aaa</dd>
<dt>BBB</dt>
<dd>bb</dd>
</dl>

 

Guess you like

Origin www.cnblogs.com/wellwell/p/11326940.html