Home Web Front-end HTML Tutorial What new tag elements are added to HTML5?

What new tag elements are added to HTML5?

Nov 23, 2017 pm 03:50 PM
h5 html5 element

Everyone knows that H5 has added a lot of new element tags, so let us summarize for you, what tags has been added to H5? What do these tags do?

Input type="XXX"

Email: The prompt format is incorrect

url Address: Address format: http://www.....

Number: Numeric type

Attributes: min minimum max maximum

Range: Input field for numbers within the range Slider understanding

Date: Date selector

Tel: Input box for phone number

Color: Color selector

New form attribute:

autocomplete attribute specifies form or input The domain should have autocomplete functionality. Value on is turned on and off is turned off.

The autofocus attribute of the form prompt box stipulates that the field automatically gains focus when the page is loaded. autofocus="autofocus" There is only one

formaction on the page - rewrite the action attribute of the form and redirect the form submission. When the form data is submitted, it is submitted to that page for data processing

formmethod - rewrite The method attribute of the form

The width and height of the input element of image type

height:

width:

list: The attribute specifies the datalist of the input field

Explanation: The associated option input-à is associated into a drop-down list datalist list="val" =è datalist id="val"

All options in Datalist must be option

Label Tip

Value The value that appears in the drop-down list

required attribute stipulates that the input field must be filled in before submission (cannot be empty). Required fields can be used on all input type elements.

Case:

Css代码
@charset "utf-8";
/* CSS Document */
*{ margin:0px;padding:0px;}
ul,li{ list-style:none;}
a{ text-decoration:none;}
header{
      border:0px solid #ff0000;
      width:90%;
      height:80px;
      margin:0 auto;
      font-size:50px;
      background-color:#E9F8FE;
      text-align:center;
      line-height:80px;
}
nav{
      width:90%;
      height:30px;
      margin:20px auto;
      border:0px solid #ff0000;
      background-color:#8CCFF0; 
}
nav ul{ padding-left:30px;}
nav ul li{
      width:80px;
      float:left;
      line-height:30px;
      font-weight:bold;    
}
nav ul li a:hover{ color:#F00;}
 
section{
      height:600px;
      width:90%;
      border:1px solid #CCC;
      margin:0 auto;  
}
aside{
     width:20%;
      float:left;
      height:600px;
      border-right:1px solid #ccc; 
}
aside ul{
      border:0px solid #00ff00;
      height:400px;   
}
aside ul li a{
      color:#000;
      line-height:40px;
      border-bottom:1px solid #ccc;
      text-align:center;
      display:block;   
}
form{
     width:75%;
      float:left;
      margin-left:10px;    
      padding-left:30px;
      padding-top:20px;
}
form p{ line-height:30px;}
 
footer{
      width:90%;
      height:100px;
      text-align:center;
      margin-top:20px;    
}
Copy after login
Html代码
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header>
      XXX科技有限公司出品
</header>
<nav>
      <ul>
          <li><a href="#">首    页</a></li>
          <li><a href="#">关于我们</a></li>
          <li><a href="#">产品介绍</a></li>
          <li><a href="#">联系我们</a></li>
    </ul>
</nav>
<section>
      <aside>
        <ul>
            <li><a href="#">客服中心</a></li>
            <li><a href="#">用户中心</a></li>
            <li><a href="#">产品中心</a></li>
            <li><a href="#">反馈中心</a></li>
        </ul>
    </aside>
      <form action="1.html">
          <p>用户名<input type="text" name="uName"></p>
          <p>邮箱<input type="email" name="uEmail"></p>
          <p>
              性别<input type="text" list="uSex" name="sex">
               <datalist id="uSex">
                 <option value="男"></option>
                 <option value="女"></option>
             </datalist>
        </p>
          <p>手机<input type="tel" name="uTel"></p>
          <p><input type="submit" value="注册"></p>
    </form>
</section>
<footer>
      京ICP:111111111 地址:XXXXXX
</footer>
</body>
</html>
Copy after login

There are so many new tags and functions in H5. For more exciting content, please pay attention to other related articles on the php Chinese website!

Related reading:

HTML drop-down menu code

How to use the

tag of html

How to use the

tag element of HTML5

The above is the detailed content of What new tag elements are added to HTML5?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

HTML Input Placeholder HTML Input Placeholder Sep 04, 2024 pm 04:54 PM

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.

See all articles