HTML5 and CSS3 - The Future of The Web Programming
HTML5 and CSS3 - The Future of The Web Programming
Web Programming
HTML5
Sergio Lujn Mora
Content
What is HTML5?
HTML5 support
New tags in HTML5
Transformation of a document from HTML4 to
HTML5
More information
WHAT IS HTML5?
What is HTML5?
In 1998, the W3C decided that they
would not continue to evolve HTML
The future was based on XML: XHTML
HTML 4.01 XHTML 1.0
What is HTML5?
XHTML:
XML syntax rules such as case-sensitive
tags, quoting attributes, closing some tags
while self-closing others, and others
Three flavors were developed
XHTML Strict
XHTML Transitional, designed to help people
move to XHTML Strict
XHTML Frameset
What is HTML5?
Opera + Mozilla + Apple formed
WHATWG (Web Hypertext Application
Technology Working Group) in 2004
http://www.whatwg.org
HTML5 SUPPORT
HTML5
New semantic elements:
<section>
<nav>
<article>
<aside>
<hgroup>
<header>
<footer>
<time>
<mark>
TRANSFORMATION OF A
DOCUMENT FROM HTML4 TO
HTML5
HTML5
<!DOCTYPE html>
<html
xmlns="http://www.w3.org/1999/xhtml"
lang="en" xml:lang="en">
10
HTML5
<html lang="en">
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8">
11
HTML5
<meta charset="utf-8" />
HTML5
All of these are equally valid in HTML5:
<META
<META
<META
<META
<meta
<meta
<meTa
<meTa
CHARSET=UTF-8>
CHARSET=UTF-8 />
CHARSET=UTF-8>
CHARSET=UTF-8 />
charset=utf-8>
charset=utf-8 />
CHARset=utf-8>
CHARset=utf-8 />
12
HTML5
Just because you can use any of the
aforementioned syntaxes doesnt mean
you should mix them all up
HTML5
Valid (strange) document:
<!DOCTYPE html>
<meta charset=utf-8>
<title>Valid document</title>
<p>This is a valid page!</p>
13
HTML5
Browsers add the missing elements
Omitting these elements from your
markup is likely to confuse
14
HTML5
<!DOCTYPE html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>Valid document</title>
</head>
<body>
<p>This is a valid page!</p>
</body>
</html>
15
16
<div id=header>
<div
id=nav>
<div id=entry>
<div id=footer>
17
<header>
<nav>
<article>
<footer>
<div id="header">
<h1>My Weblog</h1>
<p class="tagline">A lot of effort
went into making this effortless.</p>
</div>
18
HTML5
<header>
<h1>My Weblog</h1>
<p class="tagline">A lot of effort
went into making this effortless.</p>
</header>
HTML5
<header>
<hgroup>
<h1>My Weblog</h1>
<h2>A lot of effort went into making
this effortless.</h2>
</hgroup>
</header>
19
<div class="entry">
<p class="post-date">October 22, 2009</p>
<h2>
<a href="#" rel="bookmark" title="link to this
post"> Travel day </a>
</h2>
<!-- The content of the entry -->
<p></p>
</div>
HTML5
<article>
<header>
<p class="post-date">October 22, 2009</p>
<h1>
<a href="#" rel="bookmark" title="link to this
post"> Travel day </a>
</h1>
</header>
<!-- The content of the entry -->
<p></p>
</article>
20
HTML5
<article>
<header>
<time datetime="2009-10-22" pubdate>October
22, 2009</time>
<h1>
<a href="#" rel="bookmark" title="link to this
post"> Travel day </a>
</h1>
</header>
<!-- The content of the entry -->
<p></p>
</article>
HTML5
<article>
<header>
<time datetime="2009-10-22"
pubdate>22/10/2009</time>
<h1>
<a href="#" rel="bookmark" title="link to this
post"> Travel day </a>
</h1>
</header>
<!-- The content of the entry -->
<p></p>
</article>
21
HTML5
<article>
<header>
<time datetime="2009-10-22"
pubdate>22.10.2009</time>
<h1>
<a href="#" rel="bookmark" title="link to this
post"> Travel day </a>
</h1>
</header>
<!-- The content of the entry -->
<p></p>
</article>
<div id="nav">
<ul>
<li><a href="#">home</a></li>
<li><a href="#">blog</a></li>
<li><a href="#">gallery</a></li>
<li><a href="#">about</a></li>
</ul>
</div>
22
HTML5
<nav>
<ul>
<li><a
<li><a
<li><a
<li><a
</ul>
</nav>
href="#">home</a></li>
href="#">blog</a></li>
href="#">gallery</a></li>
href="#">about</a></li>
<div id="footer">
<p>§</p>
<p>© 2001–9 <a
href="#">Mark Pilgrim</a></p>
</div>
23
HTML5
<footer>
<p>§</p>
<p>© 2001–9 <a
href="#">Mark Pilgrim</a></p>
</footer>
MORE INFORMATION
24
http://www.20thingsilearned.com/
http://diveintohtml5.org/
25
http://www.html5rocks.com/en/
http://html5demos.com/
26
http://introducinghtml5.com/
27
28
29