Introduction to HTML5
What does HTML5 look like and how to use it? In fact, in the first chapter of our HTML tutorial, the codes used in the examples we gave you were all written in HTML. Let’s take a closer look at HTML5
## Introduction to HTML5
What is HTML5?
HTML5 is the next generation HTML standard.
HTML, the previous version of HTML 4.01 was born in 1999. The world of the Web has changed dramatically since then.
HTML5 is still a work in progress. However, most modern browsers already have some HTML5 support.
How did HTML5 get started?
HTML5 is the result of collaboration between W3C and WHATWG, which stands for Web Hypertext Application Technology Working Group. .
The WHATWG focuses on web forms and applications, while the W3C focuses on XHTML 2.0. In 2006, the two parties decided to collaborate to create a new version of HTML.
Some interesting new features in HTML5:
Canvas element for drawing
Video and audio elements for media playback
For local Better support for offline storage
New special content elements, such as article, footer, header, nav, section
New form controls, such as calendar, date, time, email, url, search
HTML5
declaration must be located on the first line of the HTML5 document and is very simple to use:
You can see if our first chapter example starts with
The smallest HTML5 document
The following is a simple HTML5 document:
文档标题 文档内容......
Note: For Chinese web pages, you need to use to declare the encoding, otherwise garbled characters will appear.
Improvements in HTML5
- ##New elements
- New properties
- Fully supports CSS3
- Video and Audio
- 2D/3D graphics
- Local storage
- Local SQL data
- Web application
HTML5 Multimedia
##HTML5 ApplicationUsing HTML5 you can simply develop applications
-
Local data storage
- Access local File
- Local SQL Data
- Cache Reference
- Javascript Worker
- XHTMLHttpRequest 2
Using HTML5 you can simply Draw graphics:
- Use inline SVG
- Use CSS3 2D/3D
HTML5 using CSS3
New Selector
New Properties
Animation
2D/3D Conversion
Rounded Corners
Shadow effect
Downloadable font
Please learn more about CSS3 Check out this site’s CSS3 tutorial.
Semantic Elements
HTML5 adds a lot of semantic elements as follows:
![]() |
HTML5 is the latest revised version of HTML. The standard was completed by the World Wide Web Consortium (W3C) in October 2014.HTML5 is designed to support multimedia on mobile devices.HTML5 is simple and easy to learn. |
tag | Description |
Define independent content areas of the page. | |
Allows you to set a piece of text independent of the text direction setting of its parent element. | |
Define command buttons, such as radio buttons, check boxes or buttons |
Used to describe the details of a document or a certain part of the document | |
The label contains the title of the details element | |
Specifies independent stream content (images, charts, photos, code, etc.). | |
Definition of the title of the |
Define the footer of section or document. | |
Defines the header area of the document | |
Define text with tokens. | |
Define weights and measures. Use only for measurements with known maximum and minimum values. | |
Define the part of the navigation link. |
Define the progress of any type of task. | |
Define ruby comments (Chinese pinyin or characters). | |
HTML5 Form
New form elements, new attributes, new input types, automatic validation.
##Element removed
- ##
You You can find a video locally, put the location and name of the video in src, try it
You can make some older browsers (that do not support HTML5) support HTML5.
Modern browsers support HTML5.
Additionally, all browsers, old and new, will automatically treat unrecognized elements as inline elements.
Because of this, you can "teach the browser" to handle "Unknown" HTML elements.
You can even teach the IE6 (Windows XP 2001) browser to handle unknown HTML elements.
##Defining HTML5 elements as block elements
##header,section,footer,aside,nav,main,article,figure{Display: block;}
Add new elements to HTMLYou can add new elements to HTML.
This example adds a new element to HTML and defines a style for the element. The element is named
php中文网(php.cn) 为 HTML 添加新元素 我的第一个标题
我的第一个段落。
我的第一个新元素
Run the program to see
The JavaScript statement document.createElement("myHero") is to add a new element to the IE browser.
Internet Explorer browser issues
You can use the above method to add HTML5 elements for IE browser, but:
Internet Explorer 8 and earlier IE browsers do not support the above method.
We can solve this problem using "HTML5 Enabling JavaScript", " shiv" created by Sjoerd Visscher:
The above code is a comment, which is used to read the html5.js file when the IE browser version is smaller than IE9 , and parse it.
Note: Domestic users please use Baidu static resource library (Google resource library is unstable in China):
html5shiv is a better solution for IE browser. html5shiv mainly solves the problem that the new elements proposed by HTML5 are not recognized by IE6-8. These new elements cannot be used as parent nodes to wrap child elements, and CSS styles cannot be applied.
##Perfect Shiv solution
- Course Recommendations
- Courseware download
IntermediateFront-end Vue3 actual combat [handwritten vue project]
2857 people are watchingElementaryAPIPOST tutorial [Popularization of technical concepts related to network communication]
1795 people are watchingIntermediateIssue 22_Comprehensive actual combat
5521 people are watchingElementaryIssue 22_PHP Programming
5172 people are watchingElementaryIssue 22_Front-end development
8713 people are watchingIntermediateBig data (MySQL) video tutorial full version
4525 people are watchingElementaryGo language tutorial-full of practical information and no nonsense
2794 people are watchingElementaryGO Language Core Programming Course
2814 people are watchingIntermediateJS advanced and BootStrap learning
2563 people are watchingIntermediateSQL optimization and troubleshooting (MySQL version)
3374 people are watchingIntermediateRedis+MySQL database interview tutorial
2963 people are watchingElementaryDeliver food or learn programming?
5708 people are watching
Students who have watched this course are also learning
- Let's briefly talk about starting a business in PHP
- Quick introduction to web front-end development
- Large-scale practical Tianlongbabu development of Mini version MVC framework imitating the encyclopedia website of embarrassing things
- Getting Started with PHP Practical Development: PHP Quick Creation [Small Business Forum]
- Login verification and classic message board
- Computer network knowledge collection
- Quick Start Node.JS Full Version
- The front-end course that understands you best: HTML5/CSS3/ES6/NPM/Vue/...[Original]
- Write your own PHP MVC framework (40 chapters in depth/big details/must read for newbies to advance)
- About us Disclaimer Sitemap
- php.cn:Public welfare online PHP training,Help PHP learners grow quickly!