1. New doctype and Character Set
One of the principles of HTML5 is to simplify the complexity, and the doctype on the Web page is greatly simplified.
<!DOCTYPE html>
Character Set Declaration is also simplified:
<meta charset="utf-8">
2. New and Old Elements
HTML5 introduces many new tags, which are divided into seven categories based on different content and types.
3. semantic tags
Semantic tags simplify the design of HTML pages. In the future, search engines will also take advantage of these elements when capturing and indexing webpages.
One of the purposes of html5. Google analyzed millions of pages and found that the common ID names of Div tags are large. For example, many developers prefer to use Div id = "footer" to mark footer content,
Therefore, HTML5 introduces a new set of fragment class elements.
4. HTML5 code sample
<! Doctype HTML>
Demo:
5. Set the content style in CSS
<! Doctype HTML>
Demo: