HTML5 - lishiying410/HTML-Notes GitHub Wiki

The sample code of HTML5 is like below:

<!DOCTYPE html>

<html>

`<head>`

 `<meta charset="UTF-8">`
  
 `<title>HTML tab title</title>`
  
`</head>`

`<body>`

`</body>`

</html>

HTML5 has defined 8 new semantic block-level elements, refer http://www.w3schools.com/html/html5_semantic_elements.asp

header, section, footer,aside, nav, main, article, figure

We can also define our own HTML5 elements, like <sli></sli>, those new semantic block-level level are all <div> elements with different ids in HTML4 before,since those semantic elements has been built in HTML5, we can delete our unnecessary css style code for those those semantic elements.

**<article>** Defines an article

**<aside> ** Defines content aside from the page content

**<details>** Defines additional details that the user can view or hide

**<figcaption>** Defines a caption for a

element

**<figure>** Specifies self-contained content, like illustrations, diagrams, photos, code listings, etc.

**<footer>** Defines a footer for a document or section

**<header>** Specifies a header for a document or section

**<main>** Specifies the main content of a document

**<mark>** Defines marked/highlighted text

**<nav>** Defines navigation links

**<section>** Defines a section in a document

**<summary>** Defines a visible heading for a <details> element

**<time>** Defines a date/time

How tomigrate HTML4 code to HTML5 code

⚠️ **GitHub.com Fallback** ⚠️