HTML5 has been out for a long time. However, since I am not a front-end person, I only know about this thing, and the specific concept is a bit vague (actually it is a series of standards); therefore, last year, I made a simple summary of HTML5. I just happened to see it today, so I organized it and put it on my blog to avoid losing it. Please correct me if there are any mistakes, I am a front-end noob.
Let’s start with a table of contents, as follows:
•What is HTML5
•HTML5 development history
•HTML5 detailed introduction
•Video/Audio, Canvas & SVG, Editable Content & Drag and Drop, Web Storage, Web Workers, Server Sent Events, Form Enhancements, Semantic Markup, and More HTML5 Standards
• HTML5 Example Analysis
•Flying Bird
•Bar Chart
•HTML5 Development Outlook
•Reference Resources
What is HTML5
Simply put, HTML5 is the general term for a series of related technologies used to develop modern rich Web content.
HTML5 ≈ HTML5 core specification + CSS 3 + JavaScript; HTML5 and CSS are mainly responsible for the interface, and JavaScript is responsible for logical processing;
Purpose: Reduce the dependence of Rich Internet Applications (RIA) on Flash, Silverpght, Java Applet, etc., and provide more APIs that can effectively enhance network applications.
The following picture is a typical RIA (Rich Internet Apppcations) web page, including some charts, videos, games, etc.:
##HTML5 Development History
In 2004, WHATWG (Web Hypertext Technology Working Group) proposed a draft Web Apppcations 1.0, the predecessor of HTML5;
In 2007, W3C agreed to adopt HTML5 as a standard. And established a new HTML working team;
On October 28, 2014, W3C officially released the HTML5.0 recommended standard;
Before the end of 2016, it plans to release HTML 5.1;
In the future, after HTML5.1 is announced, the working group will repeat the steps of HTML5.1 and create a new HTML5.2 to continue to improve and enrich functions.
The following table shows the evolution of the HTML 5 standard:
2012 |
2013 |
2014 |
2015 |
2016 |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Candidate Version |
Solicitation Evaluation |
Recommended standards |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
First Working Draft |
|
Final Call |
Candidate Version |
Recommended Standard |
##HTML 5.2 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
Tips: <video width="320" height="240" controls="controls"> <source src="/i/movie.ogg" type="video/ogg"> <source src="/i/movie.mp4" type="video/mp4"> Your browser does not support the video tag. </video> XML/HTML Code Copy content to clipboard <audio controls="controls"> <source src="/i/song.ogg" type="audio/ogg"> <source src="/i/song.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> is as follows, for the effect of video and audio Figure: <canvas id="myCanvas" width="200" style="max-width:90%" style="border:1px sopd #c3c3c3;"> Your browser does not support the canvas element. </canvas> <script type="text/javascript"> var c=document.getElementById("myCanvas"); var ccxt=c.getContext("2d"); cxt.moveTo(10,10); cxt.pneTo(150,50); cxt.pneTo(10,50); cxt.stroke(); </script> is as follows, the rendering: <svg xmlns="http://www.w3.org/2000/svg" version="1.1" style="max-width:90%"> <polygon points="100,10 40,180 190,60 10,60 160,180" style="fill:red;stroke:blue;stroke-width:3;fill-rule:evenodd;" /> </svg>
<script type="text/javascript"> function allowDrop(ev) { ev.preventDefault(); } function drag(ev) { ev.dataTransfer.setData("Text",ev.target.id); } function drop(ev) { ev.preventDefault(); var data=ev.dataTransfer.getData("Text"); ev.target.appendChild(document.getElementById(data)); } </script> </head> <body> <p id="p1" ondrop="drop(event)" ondragover="allowDrop(event)"> <img src="/static/imghwm/default1.png" data-src="/i/w3school_logo_black.gif" class="lazy" draggable="true" ondragstart="drag(event)" id="drag1" / alt="Summary of the latest HTML standard HTML5" > </p> <p id="p2" ondrop="drop(event)" ondragover="allowDrop(event)"></p>
<script type="text/javascript"> localStorage.lastname="Smith"; document.write("Last name: " + localStorage.lastname); </script> sessionStorage <script type="text/javascript"> sessionStorage.lastname="Smith"; document.write(sessionStorage.lastname); </script> Tips: <script> var w; function startWorker() { if (typeof (Worker) !== "undefined") { if (typeof (w) == "undefined") { w = new Worker("rs/demo_workers.js"); } w.onmessage = function(event) { document.getElementById("result").innerHTML = event.data; }; } else { document.getElementById("result").innerHTML = "Sorry, your browser does not support Web Workers..."; } } function stopWorker() { w.terminate(); } </script> demo_workers.js文件,其中的postMessage() 方法 ,用于向 HTML 页面传回一段消息。 var i=0; function timedCount() { i=i+1; postMessage(i); setTimeout("timedCount()",500); } timedCount(); Tips: pubpc class SSE extends ActionSupport { private InputStream sseStream; pubpc InputStream getSseStream() { return sseStream; } pubpc String handleSSE() { System.out.println("Inside handleSSE() "); String result = "data: "+new Date().toString() + "\n\n"; sseStream = new ByteArrayInputStream(result.getBytes() ); System.out.println("Exiting handleSSE() "); return SUCCESS; } } JavaScript Code复制内容到剪贴板 <action name="handleSSE" class="pichen.java.html5.test.SSE" method="handleSSE"> <result name="success" type="stream"> <param name="contentType">text/event-stream</param> <param name="inputName">sseStream</param> </result> </action> 客户端代码: <p><output id="result">OUTPUT VALUE</output></p> <script> (function(global, window, document) { 'use strict'; function main() { window.addEventpstener('DOMContentLoaded', contentLoaded); } function contentLoaded() { var result = document.getElementById('result'); var stream = new EventSource('handleSSE.action'); stream.onmessage=function(event){ var data = event.data+" by onmessage"; result.value = data; } } main(); })(this, window, window.document); </script> HTML 5 表单增强功能
HTML5 Semantic Tags |

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 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.

How to write clean and efficient HTML5 code? The answer is to avoid common mistakes by semanticizing tags, structured code, performance optimization and avoiding common mistakes. 1. Use semantic tags such as, etc. to improve code readability and SEO effect. 2. Keep the code structured and readable, using appropriate indentation and comments. 3. Optimize performance by reducing unnecessary tags, using CDN and compressing code. 4. Avoid common mistakes, such as the tag not closed, and ensure the validity of the code.

H5 improves web user experience with multimedia support, offline storage and performance optimization. 1) Multimedia support: H5 and elements simplify development and improve user experience. 2) Offline storage: WebStorage and IndexedDB allow offline use to improve the experience. 3) Performance optimization: WebWorkers and elements optimize performance to reduce bandwidth consumption.

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.


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

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

Hot Article

Hot Tools

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

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

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

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version
Visual web development tools