Introduzione a HTML5

HTML5 examples in each chapter

Example

<!DOCTYPE html>
<html>
<body>
<video width="420" controls>
  <source src="mov_bbb.mp4" type="video/mp4">
  <source src="mov_bbb.ogg" type="video/ogg">
 Your browser does not support the video tag.
</video>
</body>
</html>

Try it yourself

Click 'Try it yourself' to see how this example runs.

What is HTML5?

HTML5 is the latest HTML standard.

HTML5 is designed specifically to carry rich web content without the need for additional plugins.

HTML5 has new semantic, graphic, and multimedia elements.

The new elements and APIs provided by HTML5 simplify the construction of web applications.

HTML5 is cross-platform and designed to run on different types of hardware (PC, tablet, smartphone, TV, etc.).

Note:In the following chapters, you will learn how to 'help' older versions of browsers handle HTML5.

What's new in HTML5?

The new document type (DOCTYPE) declaration in HTML5 is very simple:

<!DOCTYPE html>
The new character encoding (charset) declaration is also very simple:
<meta charset="UTF-8">

HTML5 example:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document</title>
</head>
<body>
Content of the document......
</body>
</html>

Note:The default character encoding in HTML5 is UTF-8.

HTML5 - New attribute syntax

HTML5 standard allows 4 different attribute syntaxes.

Questo esempio dimostra l'uso di diverse sintassi nell'etichetta <input>:

Tipo Esempio
Vuoto <input type="text" value="Bill Gates" disabled>
Unquoted <input type="text" value=Bill Gates>
Double-quoted <input type="text" value="Bill Gates">
Single-quoted <input type="text" value='Bill Gates'>

Nello standard HTML5, a seconda delle esigenze dell'attributo, potrebbe essere utilizzata una delle 4 sintassi.

Nuove caratteristiche HTML5

Alcune delle nuove caratteristiche più interessanti di HTML5:

  • Nuovi elementi semantici, come <header>, <footer>, <article> e <section>.
  • Nuovi controlli di formulari, come numero, data, ora, calendario e slider.
  • Supporto potente per le immagini (attraverso <canvas> e <svg>)
  • Supporto multimediale potente (attraverso <video> e <audio>)
  • Nuovi API potenti, come il sostituto dei cookie con lo storage locale.

Elementi eliminati HTML5

I seguenti elementi HTML 4.01 sono stati rimossi dall'HTML5:

  • <acronym>
  • <applet>
  • <basefont>
  • <big>
  • <center>
  • <dir>
  • <font>
  • <frame>
  • <frameset>
  • <noframes>
  • <strike>
  • <tt>