search
HomeWeb Front-endH5 TutorialNew features of HTML5 (1) _html5 tutorial skills

HTML5 is a standard version of HTML [1] (an application under the Standard Universal Markup Language) that replaces the HTML 4.01 and XHTML 1.0 standards formulated in 1999; it is still in the development stage, but most browsers already support it Certain HTML5 technologies.

1. New document type declaration
The three document type declarations specified by HTML4:

XML/HTML CodeCopy content to clipboard
  1. -//W3C//DTD HTML 4.01//EN”http://www.w3.org/TR/html4/strict.dtd” >
  2. -//W3C//DTD HTML4.01//EN”http://www.w3.org/TR/html4/loose.dtd”>
  3. -//W3C//DTD HTML4.01//EN” http://www.w3.org/TR/html4/frameset.dtd”>

The three document type declarations specified by XHTML 1.0:

XML/HTML CodeCopy content to clipboard
  1. -//W3C//DTD XHTML 1.0 Strict//EN” http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict .dtd”> 
  2. -//W3C//DTD XHTML 1.0 Transitional//EN” http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd” >
  3. -//W3C//DTD XHTML 1.0 Frameset//EN” http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd” >

XHTML 1.1 document strictly defines the type, which is equivalent to the transitional definition type of XHTML1.0 document

XML/HTML CodeCopy content to clipboard
  1. -//W3C//DTD XHTML 1.1//EN” http://www.w3.org/TR/xhtml11/DTD/xhtml1.dtd” >

Document type declaration for HTML 5

XML/HTML CodeCopy content to clipboard
  1. /span>>

2. There is no need to write type in script and link

XML/HTML CodeCopy content to clipboard
  1. link rel=”stylesheet” href=”path/to/stylesheet.css” type=”text/css” />   ==》  link rel=”stylesheet” href=”path/to/stylesheet.css”/>  
  2. script src=”path/to/script.js” type=”text/javascript”>script>    ==》  script src=”path/to/script.js”>script>  

3. 语义化header和footer标签
在HTML4或XHTML里,我们定义网页的页眉或页脚时会这样:

XML/HTML Code复制内容到剪贴板
  1. div id=”header”>  
  2. …   
  3. div>  
  4. 或   
  5. div id=”footer”>  
  6. …   
  7. div>  

而在HTML5里有直接定义上面元素块的标签,可以使代码更加的简洁和语义化

XML/HTML Code复制内容到剪贴板
  1. header>  
  2. …   
  3. header>  
  4. 或   
  5. footer>  
  6. …   
  7. footer>  

4. hgroup标签,它主要是表明标题的集合。如果有主标题、副标题,可以用这个来包裹一下。但是这个标签没什么大的用处,在最新的HTML5.1版中被废除了。我们如果想声明主标题和对应副标题说明,可以向下面这样。
使用标点符号分割,一般适合于文章标题,不太适合网站标题。

XML/HTML Code复制内容到剪贴板
  1. h1>Front-end test questions: New features of HTML5h1>

Use span tags to mark subtitle descriptions

XML/HTML CodeCopy content to clipboard
  1. h1>Front-end test questions
  2.  span>New features of HTML5span>
  3. h1>

Use header tags to wrap the title and description

XML/HTML CodeCopy content to clipboard
  1. header>
  2.  h1>Front-end test questionsh1> 
  3.  p>New features of HTML5p>
  4. header>

5. Mark element mark

XML/HTML CodeCopy content to clipboard
  1. The mark> element represents a run of text in one document marked or highlighted for reference purposes, due to its relevance in another context.

can be used as a highlight tag, and the characters enclosed by it will be highlighted.
6. Graphic element figure
In HTML4 or XHTML, the following codes are used to decorate the comments of the picture .

XML/HTML CodeCopy content to clipboard
  1. img src=”path/to/image” alt=”About image”/>
  2. p>Image of Flower p>

The above code does not connect text and image memory, but the figure and figcaption combination added by HTML5 can perfectly connect images and text.

XML/HTML CodeCopy content to clipboard
  1. figure>
  2. img src=”path/to/image” alt=”About image”/>
  3. figcaption>
  4.  p>beautiful flowerp> 
  5. figcaption>
  6. figure>

7. Redefined the small tag
The tag in HTML5 renders marginalia as small text, responsible for statements, precautions, legal restrictions or versions Declared features are usually small text.
Small has been defined in HTML4 or XHTML, but there is no complete explanation of its use. In HTML, it is mainly used for small text such as version statements and email addresses at the bottom of web pages.
8. Placeholder
In HTML4 or XHTML, if we want to display a prompt message when the input box is empty, the input box field will be focused. The effect of prompt disappearing can only be written with js. The placeholder added in HTML5 directly achieves this effect.
The placeholder attribute is applicable to the following types: text, search, url, telephone, email and password.

XML/HTML CodeCopy content to clipboard
  1. input placeholder=”text”>
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
H5: New Features and Capabilities for Web DevelopmentH5: New Features and Capabilities for Web DevelopmentApr 29, 2025 am 12:07 AM

H5 brings a number of new functions and capabilities, greatly improving the interactivity and development efficiency of web pages. 1. Semantic tags such as enhance SEO. 2. Multimedia support simplifies audio and video playback through and tags. 3. Canvas drawing provides dynamic graphics drawing tools. 4. Local storage simplifies data storage through localStorage and sessionStorage. 5. The geolocation API facilitates the development of location-based services.

H5: Key Improvements in HTML5H5: Key Improvements in HTML5Apr 28, 2025 am 12:26 AM

HTML5 brings five key improvements: 1. Semantic tags improve code clarity and SEO effects; 2. Multimedia support simplifies video and audio embedding; 3. Form enhancement simplifies verification; 4. Offline and local storage improves user experience; 5. Canvas and graphics functions enhance the visualization of web pages.

HTML5: The Standard and its Impact on Web DevelopmentHTML5: The Standard and its Impact on Web DevelopmentApr 27, 2025 am 12:12 AM

The core features of HTML5 include semantic tags, multimedia support, offline storage and local storage, and form enhancement. 1. Semantic tags such as, etc. to improve code readability and SEO effect. 2. Simplify multimedia embedding with labels. 3. Offline storage and local storage such as ApplicationCache and LocalStorage support network-free operation and data storage. 4. Form enhancement introduces new input types and verification properties to simplify processing and verification.

H5 Code Examples: Practical Applications and TutorialsH5 Code Examples: Practical Applications and TutorialsApr 25, 2025 am 12:10 AM

H5 provides a variety of new features and functions, greatly enhancing the capabilities of front-end development. 1. Multimedia support: embed media through and elements, no plug-ins are required. 2. Canvas: Use elements to dynamically render 2D graphics and animations. 3. Local storage: implement persistent data storage through localStorage and sessionStorage to improve user experience.

The Connection Between H5 and HTML5: Similarities and DifferencesThe Connection Between H5 and HTML5: Similarities and DifferencesApr 24, 2025 am 12:01 AM

H5 and HTML5 are different concepts: HTML5 is a version of HTML, containing new elements and APIs; H5 is a mobile application development framework based on HTML5. HTML5 parses and renders code through the browser, while H5 applications need to run containers and interact with native code through JavaScript.

The Building Blocks of H5 Code: Key Elements and Their PurposeThe Building Blocks of H5 Code: Key Elements and Their PurposeApr 23, 2025 am 12:09 AM

Key elements of HTML5 include,,,,,, etc., which are used to build modern web pages. 1. Define the head content, 2. Used to navigate the link, 3. Represent the content of independent articles, 4. Organize the page content, 5. Display the sidebar content, 6. Define the footer, these elements enhance the structure and functionality of the web page.

HTML5 and H5: Understanding the Common UsageHTML5 and H5: Understanding the Common UsageApr 22, 2025 am 12:01 AM

There is no difference between HTML5 and H5, which is the abbreviation of HTML5. 1.HTML5 is the fifth version of HTML, which enhances the multimedia and interactive functions of web pages. 2.H5 is often used to refer to HTML5-based mobile web pages or applications, and is suitable for various mobile devices.

HTML5: The Building Blocks of the Modern Web (H5)HTML5: The Building Blocks of the Modern Web (H5)Apr 21, 2025 am 12:05 AM

HTML5 is the latest version of the Hypertext Markup Language, standardized by W3C. HTML5 introduces new semantic tags, multimedia support and form enhancements, improving web structure, user experience and SEO effects. HTML5 introduces new semantic tags, such as, ,, etc., to make the web page structure clearer and the SEO effect better. HTML5 supports multimedia elements and no third-party plug-ins are required, improving user experience and loading speed. HTML5 enhances form functions and introduces new input types such as, etc., which improves user experience and form verification efficiency.

See all articles

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software