html5 is the fifth revision of Hypertext Markup Language (HTML), so some new tags have been added to html5. So, what are the new tags in html5? What I will introduce to you below is the new tags added in html5 compared to html.
1. New tags in HTML5
Header - can represent a container for introduction content, or a set of navigation links.
Nav - The content of the label is mainly used for navigation.
Article - identifies the main content in the page. Taking a blog as an example, each post is an important piece of content, and Article can be used to identify each post.
Section - Used to mark important sections on the page. This markup is similar to dividing a document into chapters.
Aside - Indicates that it is related to the main content of the page, but is not part of the page. It often indicates a related link.
Footer - Opposite to Header, it represents the footer of the document or chapter. For example, copyright information is placed in this tag.
Traditional div layout
<body> <!-- 页头 --> <div class='header'></header> <!-- 导航 --> <div class='nav'></div> <!-- 主体内容 --> <div class='main'> <!-- 文章 --> <div class='article'> <!-- 节 --> <div class='section'></div> </div> <!-- 边栏 --> <div class='sidebar'></div> </div> <!-- 页脚 --> <div class='footer'></div></body>
Use the new tags in HTML5 to implement layout
<body> <header></header> <nav></nav> <div> <article> <section></section> </article> <aside></aside> </div> <footer></footer></body>
2. Enhanced application of forms
In HTML 4, some simple form elements are provided to handle basic input. For certain types of input, such as date and time input, the interactive experience cannot meet the needs. Therefore, in order to get better results, you can only use javascript to write component implementations. Improved in HTML 5, adding new form elements to provide more input types.
(1) Input's Type attribute expansion
search - presents a search box.
tel - Enter the phone number, you can use pattern and maxlength to limit the input to the appropriate
<input type='tel' name='tel' value="" placeholder="请输入手机号码" pattern='1[3-8][0-9]{9}' title='请输入11位手机号'>
url - Enter the URL address.
email - Enter your email address.
date - Enter the date.
color - Enter color.
number - Enter a number.
range - Slider input
(2) Input form validation through attributes
required - Mark the current element as required.
pattern - Use regular expressions to validate form input.
(3) Other useful attributes of the Input element
autofocus - When the page loads, automatically focus on the current input element.
form - Associates an input element with a specific Form form.
placeholder - Input placeholder that prompts the user for input.
(4) HTML 5 new elements and special attributes contenteditable
progress - element represents a progress bar.
<progress value='30' max='100'></progress>
meter - Element representing a ruler. The maximum value max defaults to 1.
<meter value="3" min="0" max="10">3/10</meter><meter value="0.6">60%</meter>
HTML 5 special attribute contenteditable, through which an ordinary element can be made editable.
<p contenteditable="true">这里的内容式可编辑的</p>
3. Using audio and video
(1) audio (audio tag)
<audio controls> <source src="vincent.mp3" /> <source src="vincent.ogg" /> 您的浏览器不支持 audio 标签</audio>
audio The attributes that control the behavior of elements are as follows
controls - This attribute controls whether to display the standard audio space.
autoplay - Whether to play automatically. Default false.
loop - Whether to loop. Default false.
preload - Preloading method. There are three situations: none means no preloading; metadata only loads the metadata of the audio; auto means preloading the entire audio. Default auto.
volum - volume, value between 0 - 1
Methods to play and pause audio
var audio = document.getElementById('audio') audio.play() // 播放audio.pause() // 暂停
(2 ) video (video tag)
currentTime controls the time to start playing
<video width="400" height="300" controls currentTime='5'> <source src="dizzy.mp4#t=5" type="video/mp4" /> <!-- 从 5s 开始 --> <source src="dizzy.ogv#t=5,10" type="video/ogg" /> <!-- 从 5s 到 10s --> <source src="dizzy.webm#t=,15" type="video/webm"> <!-- 到 15s 结束 --> <p>您的浏览器不支持 HTML 5 视频</p></video>
Recommended related articles:
html5 basic tag (html5 video tag html5 new Tag usage)_html5 tutorial skills
##Summary of new elements and tags in HTML5
Introduction to new tags and attributes in HTML5
The above is the detailed content of What are the new tags in html5? New tag applications in html5. For more information, please follow other related articles on the PHP Chinese website!

HTML5 code consists of tags, elements and attributes: 1. The tag defines the content type and is surrounded by angle brackets, such as. 2. Elements are composed of start tags, contents and end tags, such as contents. 3. Attributes define key-value pairs in the start tag, enhance functions, such as. These are the basic units for building web structure.

HTML5 is a key technology for building modern web pages, providing many new elements and features. 1. HTML5 introduces semantic elements such as, , etc., which enhances web page structure and SEO. 2. Support multimedia elements and embed media without plug-ins. 3. Forms enhance new input types and verification properties, simplifying the verification process. 4. Offer offline and local storage functions to improve web page performance and user experience.

Best practices for H5 code include: 1. Use correct DOCTYPE declarations and character encoding; 2. Use semantic tags; 3. Reduce HTTP requests; 4. Use asynchronous loading; 5. Optimize images. These practices can improve the efficiency, maintainability and user experience of web pages.

Web standards and technologies have evolved from HTML4, CSS2 and simple JavaScript to date and have undergone significant developments. 1) HTML5 introduces APIs such as Canvas and WebStorage, which enhances the complexity and interactivity of web applications. 2) CSS3 adds animation and transition functions to make the page more effective. 3) JavaScript improves development efficiency and code readability through modern syntax of Node.js and ES6, such as arrow functions and classes. These changes have promoted the development of performance optimization and best practices of web applications.

H5 is not just the abbreviation of HTML5, it represents a wider modern web development technology ecosystem: 1. H5 includes HTML5, CSS3, JavaScript and related APIs and technologies; 2. It provides a richer, interactive and smooth user experience, and can run seamlessly on multiple devices; 3. Using the H5 technology stack, you can create responsive web pages and complex interactive functions.

H5 and HTML5 refer to the same thing, namely HTML5. HTML5 is the fifth version of HTML, bringing new features such as semantic tags, multimedia support, canvas and graphics, offline storage and local storage, improving the expressiveness and interactivity of web pages.

H5referstoHTML5,apivotaltechnologyinwebdevelopment.1)HTML5introducesnewelementsandAPIsforrich,dynamicwebapplications.2)Itsupportsmultimediawithoutplugins,enhancinguserexperienceacrossdevices.3)SemanticelementsimprovecontentstructureandSEO.4)H5'srespo

The tools and frameworks that need to be mastered in H5 development include Vue.js, React and Webpack. 1.Vue.js is suitable for building user interfaces and supports component development. 2.React optimizes page rendering through virtual DOM, suitable for complex applications. 3.Webpack is used for module packaging and optimize resource loading.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Notepad++7.3.1
Easy-to-use and free code editor

WebStorm Mac version
Useful JavaScript development tools

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)