html5 PDF
html5 PDF
HTML 5
Vinh Mai
1/28
Overview
1 Introdution
2 Recent version browser
3 HTML 5 differences from HTML 4
4 Browser render html document
5 Structure of html
6 Sumary
2/28
Introdution
3/28
Recent version browser
1 Chrome: 69
2 Firefox: 62
3 Opera: 55
4 IE: 11
5 Edge: 17
6 Safari: 12
4/28
HTML 5 differences from HTML 4
1 Syntax
2 Elements, Attributes, APIs
5/28
Syntax
1 <!DOCTYPE>
2 Character encoding
6/28
Syntax
<!DOCTYPE>
Version HTML 4
7/28
Syntax
Character encoding:
HTML 5:
<meta charset="UTF-8">
HTML 4:
<meta http-equiv="Content-Type"
content="text/html" charset="UTF-8">
8/28
Elements, Attributes and APIs
1 New elements:
Structure: header, footer, section, main, article, aside, nav,
fifure, template
9/28
Browser render html document
10/28
Structure of html document
<!DOCTYPE html>
<html> // root element
<head> // metadata
<title>
<meta>
<link>
<script>
</head>
<body> // content
<script> // script
</body>
</html>
11/28
HTML, Body element
1 HTML
Root element of html document
Encouraged to specify language based on lang attribute
// elements
<html lang="en">
</html>
12/28
Document metadata: head element
13/28
Link tag
3 primary types:
external css:
icon:
manifest:
14/28
Meta tag
Character endcoding:
<meta charset="UTF-8">
15/28
Scripting
16/28
17/28
Scripting
18/28
Elements
19/28
Article
// elements
<article>
<header>
<h2> Heading </h2>
</header>
<p> paragraph <p>
<p> paragraph <p>
</article>
20/28
Section
21/28
Section
// elements:
<article class="blog">
<h1> blog </h1>
<section class="post">
<h2> heading </h2>
<p> Paragraph <p>
</section>
<section class="post">
<h2> heading </h2>
<p> Paragraph <p>
</section>
</article>
22/28
Header
Group represents elements to introduce content
Case use:
header of page
header of self-contained of block content (as article tag)
// elements:
<article class="blog">
<header>
<img />
<input />
</header>
</article>
23/28
Footer
// elements:
<footer>
<nav>
<a href=""></a>
<a href=""></a>
</nav>
<p>Copyright 2009</p>
</footer>
24/28
Main
25/28
Nav
Enclose site navigation
Typical use list of elements in content (ul)
Can use any where: main site navigation, pagination,
previous/next article links...
// elements:
<nav>
<ul>
<li><a></a></li>
<li><a></a></li>
<li><a></a></li>
</ul>
</nav>
26/28
Aside
Content of aside tag is indirectly related to content document
Example: sidebars, group navigation,
// elements:
<aside>
<h2> blog </h2>
<ul>
<li><a href=""></a>
</ul>
<h2> blog </h2>
<ul>
<li><a></a></li>
</ul>
</aside>
27/28
Summary
28/28