Laboratorio di Web Design Base - 2014/15 - HTML/5

79
HTML & HTML5

description

All must used and usefull HTML and HTML5 tags. Thi presentation is used in my course "Laboratorio di Web Design Base" @ Centro Giovani di Monfalcone in 2014/15

Transcript of Laboratorio di Web Design Base - 2014/15 - HTML/5

Page 1: Laboratorio di Web Design Base - 2014/15 - HTML/5

HTML & HTML5

Page 2: Laboratorio di Web Design Base - 2014/15 - HTML/5

–Wikipedia

“L'HTML non è un linguaggio di programmazione, ma un linguaggio di markup, ossia descrive le modalità di

impaginazione, formattazione e visualizzazione grafica (layout) del contenuto, testuale e non,

di una pagina web”.

2

Page 3: Laboratorio di Web Design Base - 2014/15 - HTML/5

Linguaggio di marcatura Struttura semantica

3

Page 4: Laboratorio di Web Design Base - 2014/15 - HTML/5

<p>…</p>

4

Page 5: Laboratorio di Web Design Base - 2014/15 - HTML/5

<p>Questo è un paragrafo.</p>

5

Page 6: Laboratorio di Web Design Base - 2014/15 - HTML/5

<p lang=“it”>Questo è un paragrafo.</p>

6

Page 7: Laboratorio di Web Design Base - 2014/15 - HTML/5

<p lang=“it”>Questo &egrave; un paragrafo.</p>

7

Page 8: Laboratorio di Web Design Base - 2014/15 - HTML/5

<br />

8

Page 9: Laboratorio di Web Design Base - 2014/15 - HTML/5

<br>

9

Page 10: Laboratorio di Web Design Base - 2014/15 - HTML/5

StrutturaDefinizione e svolgimento

Page 11: Laboratorio di Web Design Base - 2014/15 - HTML/5

DTDOgni documento HTML deve averlo!

(Document Type Definition)

11

Page 12: Laboratorio di Web Design Base - 2014/15 - HTML/5

Il DTD è uno strumento utilizzato dai programmatori il cui scopo è quello di definire le componenti ammesse

nella costruzione di un documento XML.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!DOCTYPE html>

12

Page 13: Laboratorio di Web Design Base - 2014/15 - HTML/5

DTD

- set di elementi leciti da usare (vocabolario); - struttura logica di ogni elemento (grammatica); - attributi e valori ammessi; - utilizzato dai parser.

13

Page 14: Laboratorio di Web Design Base - 2014/15 - HTML/5

<html lang=“it”>

</html>

<!DOCTYPE html>

<head></head>

<body></body>

14

Page 15: Laboratorio di Web Design Base - 2014/15 - HTML/5

All’interno del tag <head> troveremo:

- <title>Titolo della pagia</title>

- meta-dati per applicazioni esterne (es.: motori di ricerca);

- collegamenti a file esterni (stili, script, ecc.); - stili/script inline.

15

Page 16: Laboratorio di Web Design Base - 2014/15 - HTML/5

<html lang=“it”>

</html>

<!DOCTYPE html>

<head>

<body></body>

16

</head>

<title>Chi siamo</title> <meta charset=“utf-8”>

Page 17: Laboratorio di Web Design Base - 2014/15 - HTML/5

All’interno del tag <body> troveremo tutta la parte di front-end (interfaccia) del nostro sito. !

Testo, multimedia, e tutto ciò che l’utente potrà vedere si trova esclusivamente all’interno di <body>.

17

Page 18: Laboratorio di Web Design Base - 2014/15 - HTML/5

18

<!DOCTYPE html>

<html><head>

<body>

Page 19: Laboratorio di Web Design Base - 2014/15 - HTML/5

HeadingsIntestazioni

Page 20: Laboratorio di Web Design Base - 2014/15 - HTML/5

Sezioni principali di un testo. !

Raggruppati in ordine di importanza decrescente, da

<h1> a <h6>.

20

Page 21: Laboratorio di Web Design Base - 2014/15 - HTML/5

<h1>Ligula Commodo Fringilla.</h1> <h2>Ligula Commodo Fringilla.</h2> <h3>Ligula Commodo Fringilla.</h3> <h4>Ligula Commodo Fringilla.</h4> <h5>Ligula Commodo Fringilla.</h5> <h6>Ligula Commodo Fringilla.</h6>

21

Page 22: Laboratorio di Web Design Base - 2014/15 - HTML/5

Deve esserci sempre e solo un <h1> in ogni pagina.

22

Page 23: Laboratorio di Web Design Base - 2014/15 - HTML/5

TestoParagrafi e formattazioni

Page 24: Laboratorio di Web Design Base - 2014/15 - HTML/5

Testo

<p>Raxacoricofallapatorius, first mentioned in "World War Three", is the home planet of the Raxacoricofallapatorians, including the criminal Slitheen, Blathereen and Hostrazeen families. The difficulty characters have in pronouncing its name is a recurring joke in the show.</p> <p>According to the book Monsters and Villains, the planet is a paradise with burgundy seas and four polar regions.</p>

24

Page 25: Laboratorio di Web Design Base - 2014/15 - HTML/5

Testo

Raxacoricofallapatorius, first mentioned in "World War Three", is the home planet of the Raxacoricofallapatorians, including the criminal Slitheen, Blathereen and Hostrazeen families. The difficulty characters have in pronouncing its name is a recurring joke in the show. !According to the book Monsters and Villains, the planet is a paradise with burgundy seas and four polar regions.

25

Page 26: Laboratorio di Web Design Base - 2014/15 - HTML/5

Testo

<p><strong>Raxacoricofallapatorius</strong>, first mentioned in "World War Three", is the home planet of the Raxacoricofallapatorians, including the criminal Slitheen, Blathereen and Hostrazeen families. The difficulty characters have in pronouncing its name is a recurring joke in the show.</p> <p>According to the book Monsters and Villains, the planet is a paradise with burgundy seas and four polar regions.</p>

26

Page 27: Laboratorio di Web Design Base - 2014/15 - HTML/5

Testo

<p><strong>Raxacoricofallapatorius</strong>, first mentioned in <em>"World War Three”</em>, is the home planet of the Raxacoricofallapatorians, including the criminal Slitheen, Blathereen and Hostrazeen families. The difficulty characters have in pronouncing its name is a recurring joke in the show.</p> <p>According to the book <em>Monsters and Villains</em>, the planet is a paradise with burgundy seas and four polar regions.</p>

27

Page 28: Laboratorio di Web Design Base - 2014/15 - HTML/5

Testo

Raxacoricofallapatorius, first mentioned in "World War Three", is the home planet of the Raxacoricofallapatorians, including the criminal Slitheen, Blathereen and Hostrazeen families. The difficulty characters have in pronouncing its name is a recurring joke in the show. !According to the book Monsters and Villains, the planet is a paradise with burgundy seas and four polar regions.

28

Page 29: Laboratorio di Web Design Base - 2014/15 - HTML/5

Testo

<p><strong>Raxacoricofallapatorius</strong>, first mentioned in <em>"World War Three”</em>, is the home planet of the Raxacoricofallapatorians, including the criminal Slitheen, Blathereen and Hostrazeen families. <br />The difficulty characters have in pronouncing its name is a recurring joke in the show.</p> <p>According to the book <em>Monsters and Villains</em>, the planet is a paradise with burgundy seas and four polar regions.</p>

29

Page 30: Laboratorio di Web Design Base - 2014/15 - HTML/5

Testo

Raxacoricofallapatorius, first mentioned in "World War Three", is the home planet of the Raxacoricofallapatorians, including the criminal Slitheen, Blathereen and Hostrazeen families. The difficulty characters have in pronouncing its name is a recurring joke in the show. !According to the book Monsters and Villains, the planet is a paradise with burgundy seas and four polar regions.

30

Page 31: Laboratorio di Web Design Base - 2014/15 - HTML/5

Testo

- Apice|Pedice: <sup></sup>|<sub></sub>

- Linea orizzontale: <hr />

- Quotazione: <blockquote cite=“”></blockquote>

- Citazione: <cite></cite>

- Abbreviazione: <abbr title=“”></abbr>

- Indirizzo: <address></address>

31

Page 32: Laboratorio di Web Design Base - 2014/15 - HTML/5

Testo

- Testo incorretto: <s></s>

- Testo rimosso|Testo sostituito: <del></del>| <ins></ins>

- Blocco di codice: <code></code>|<kbd></kbd>|<samp></samp>

- Preformattato: <pre></pre>

- Definizione termine: <dfn></dfn>

- Marcatore generico: <span></span>

32

Page 33: Laboratorio di Web Design Base - 2014/15 - HTML/5

ListeOrdinate, non-ordinare, di definizione

Page 34: Laboratorio di Web Design Base - 2014/15 - HTML/5

Liste

<ol> <li>Sara-Jane Smith</li> <li>Brigadier Lethbridge-Stewart</li> <li>Bad Wolf</li> <li>K-9</li> <li>Captain Jack Harkness</li> </ol>

34

Page 35: Laboratorio di Web Design Base - 2014/15 - HTML/5

Liste

1. Sara-Jane Smith 2. Brigadier Lethbridge-Stewart 3. Bad Wolf 4. K-9 5. Captain Jack Harkness

35

Page 36: Laboratorio di Web Design Base - 2014/15 - HTML/5

Liste

<ul> <li>Sara-Jane Smith</li> <li>Brigadier Lethbridge-Stewart</li> <li>Bad Wolf</li> <li>K-9</li> <li>Captain Jack Harkness</li> </ul>

36

Page 37: Laboratorio di Web Design Base - 2014/15 - HTML/5

Liste

• Sara-Jane Smith • Brigadier Lethbridge-Stewart • Bad Wolf • K-9 • Captain Jack Harkness

37

Page 38: Laboratorio di Web Design Base - 2014/15 - HTML/5

Liste

<dl> <dt>The Doctor</dt> <dd>The Doctor is a Time Lord, an extraterrestrial from the planet Gallifrey, who travels in a time machine called the TARDIS. Sometimes he is accompanied by companions who have chosen to travel with him for a variety of reasons.</dd> <dt>Dalek</dt> <dd>Iconic villain from the British TV series Dr Who. Though their appearance is robotic, the Daleks are actually little green blobs mutated from members of the Kaled species by their chief scientist, Davros, and placed in robotic armoured travel machines.</dd> </dl>

38

Page 39: Laboratorio di Web Design Base - 2014/15 - HTML/5

Liste

The Doctor The Doctor is a Time Lord, an extraterrestrial from the planet Gallifrey, who travels in a time machine called the TARDIS. Sometimes he is accompanied by companions who have chosen to travel with him for a variety of reasons. !

Dalek Iconic villain from the British TV series Dr Who. Though their appearance is robotic, the Daleks are actually little green blobs mutated from members of the Kaled species by their chief scientist, Davros, and placed in robotic armoured travel machines.

39

Page 40: Laboratorio di Web Design Base - 2014/15 - HTML/5

LinksAncore e collegamenti ipertestuali

Page 41: Laboratorio di Web Design Base - 2014/15 - HTML/5

Links

<a href=“tardis.html”>Go to the TARDIS</a>

41

Page 42: Laboratorio di Web Design Base - 2014/15 - HTML/5

Links

Go to the TARDIS

42

Page 43: Laboratorio di Web Design Base - 2014/15 - HTML/5

Links

<a href=“tardis.html”>Go to the TARDIS</a> <a href=“http://www.unit.co.uk”>Visit UNIT HQ</a> <a href=“mailto:[email protected]”>Mail to the Master</a> <a href=“#cyberman”>Read about Cyberman</a>

43

Page 44: Laboratorio di Web Design Base - 2014/15 - HTML/5

Links

<a href=“tardis.html” target=“_blank”>Go to the TARDIS</a>

44

Page 45: Laboratorio di Web Design Base - 2014/15 - HTML/5

Links

<a href=“tardis.html” title=“Go to the TARDIS and escape from Skaro.”>Go to the TARDIS</a>

45

Page 46: Laboratorio di Web Design Base - 2014/15 - HTML/5

MediaImmagini, video, audio e interattività

Page 47: Laboratorio di Web Design Base - 2014/15 - HTML/5

Media

<img src=“davros.jpg” />

47

Page 48: Laboratorio di Web Design Base - 2014/15 - HTML/5

Media

<img src=“davros.jpg” alt=“Image of Davros.” title=“The creator of the Daleks, Davros.” />

48

Page 49: Laboratorio di Web Design Base - 2014/15 - HTML/5

Media

49

The creator of the Daleks, Davros.

Page 50: Laboratorio di Web Design Base - 2014/15 - HTML/5

Media

50

Image of Davros.

Page 51: Laboratorio di Web Design Base - 2014/15 - HTML/5

Media

<figure> <img src=“davros.jpg” alt=“Image of Davros.” title=“The creator of the Daleks, Davros.” /> </figure>

51

Page 52: Laboratorio di Web Design Base - 2014/15 - HTML/5

Media

<figure> <img src=“davros.jpg” alt=“Image of Davros.” title=“The creator of the Daleks, Davros.” /> <figcaption>Davros from Doctor Who, &copy; BBC</figcaption> </figure>

52

Page 53: Laboratorio di Web Design Base - 2014/15 - HTML/5

Media

53

Davros from Doctor Who, © BBC

Page 54: Laboratorio di Web Design Base - 2014/15 - HTML/5

Media

<video poster=“tardis_video_poster.jpg” controls autoplay loop> <source src=“dw_intro.mp4” type=“video/mp4” /> <source src=“dw_intro.ogg” type=“video/ogg” /> <source src=“dw_intro.webm” type=“video/webm” /> </video>

54

Page 55: Laboratorio di Web Design Base - 2014/15 - HTML/5

Media

<video poster=“tardis_video_poster.jpg” controls autoplay loop> <source src=“dw_intro.mp4” type=“video/mp4” /> <source src=“dw_intro.ogg” type=“video/ogg” /> <source src=“dw_intro.webm” type=“video/webm” /> <track kind=“subtitles” srclang=“it” src=“dw_intro_it.vtt” /> </video>

55

Page 56: Laboratorio di Web Design Base - 2014/15 - HTML/5

Media

<audio controls autoplay loop> <source src=“dw_intro.mp3” type=“audio/mpeg” /> <source src=“dw_intro.ogg” type=“video/ogg” /> </audio>

56

Page 57: Laboratorio di Web Design Base - 2014/15 - HTML/5

Media

<canvas width=“” height=“” id=“”></canvas>

57

Page 58: Laboratorio di Web Design Base - 2014/15 - HTML/5

Contenitorie contenitori semantici

Page 59: Laboratorio di Web Design Base - 2014/15 - HTML/5

Contenitori

<div> <p>Time And Relative Dimentions In Space. A time/space machine concieved by the Time Lords. It has infinate rooms inside, including several console rooms, from which the ship can be piloted.</p> </div>

59

Page 60: Laboratorio di Web Design Base - 2014/15 - HTML/5

Contenitori

- Sezione: <section></section>

- Intestazione: <header></header>

- Articolo: <article></article>

- Footer: <footer></footer>

- Navigazione: <nav></nav>

- Barra laterale: <aside></aside>

60

Page 61: Laboratorio di Web Design Base - 2014/15 - HTML/5

TabelleDati, non layout!

Page 62: Laboratorio di Web Design Base - 2014/15 - HTML/5

Tabelle

<table> <tr> <td>Daleks</td> <td>Cyberman</td> <td>Masters (The)</td> </tr> <tr> <td>1963</td> <td>1966</td> <td>1971</td> </tr> <tr> <td>2014</td> <td>2013</td> <td>2009</td> </tr> </table>

62

Page 63: Laboratorio di Web Design Base - 2014/15 - HTML/5

Tabelle

63

Daleks 1963 2014

Cyberman 1966 2013

Master (The) 1971 2009

Page 64: Laboratorio di Web Design Base - 2014/15 - HTML/5

Tabelle

<table> <thead> <tr> <th>Viallain</th> <th>First apperance</th> <th>Last apperance</th> </tr> </thead> <tr> <td>Daleks</td> <td>Cyberman</td> <td>Masters (The)</td> </tr> </table>

64

Page 65: Laboratorio di Web Design Base - 2014/15 - HTML/5

Tabelle

65

Villain First apperance Last apperance

Daleks 1963 2014

Cyberman 1966 2013

Master (The) 1971 2009

Page 66: Laboratorio di Web Design Base - 2014/15 - HTML/5

Tabelle

<table> <tr> <td>2014</td> <td>2013</td> <td>2009</td> </tr> <tfoot> <tr> <td>Viallain</td> <td>First apperance</td> <td>Last apperance</td> </tr> </tfoot> </table>

66

Page 67: Laboratorio di Web Design Base - 2014/15 - HTML/5

Tabelle

67

Daleks 1963 2014

Cyberman 1966 2013

Master (The) 1971 2009

Villain First apperance Last apperance

Page 68: Laboratorio di Web Design Base - 2014/15 - HTML/5

FormsUser Interaction

Page 69: Laboratorio di Web Design Base - 2014/15 - HTML/5

Forms

69

Page 70: Laboratorio di Web Design Base - 2014/15 - HTML/5

Forms

70

<form action=“” method=“get|post”>…</form>

Page 71: Laboratorio di Web Design Base - 2014/15 - HTML/5

Forms

71

<fieldset> <legend>Contact information</legend> </fieldset>

Page 72: Laboratorio di Web Design Base - 2014/15 - HTML/5

Forms

72

<label for=“name”>Nome</label>

Page 73: Laboratorio di Web Design Base - 2014/15 - HTML/5

Forms

73

<input type=“” id=“” name=“” /> !<textarea id=“” name=“”></textarea> !<select id=“” name=“”> <option value=“”>Option</option> </select> !<button type=“”>Send</button>

Page 74: Laboratorio di Web Design Base - 2014/15 - HTML/5

Forms

74

http://www.w3schools.com/html/html5_form_input_types.asp

Page 75: Laboratorio di Web Design Base - 2014/15 - HTML/5

iFramesInline Frames

Page 76: Laboratorio di Web Design Base - 2014/15 - HTML/5

iFrames

76

<iframe width=“” height=“” src=“” scrolling=“” frameborder=“”></iframe>

Page 77: Laboratorio di Web Design Base - 2014/15 - HTML/5

iFrames

77

<iframe src="https://www.google.com/maps/embed?pb=!1m16!1m10!1m3!1d621.0341897165755!2d-0.19329364309344388!3d51.49235780221063!2m1!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x48760f8b6737b9db%3A0x8f5a4c580bbfd4d7!2sTARDIS!5e0!3m2!1sit!2sit!4v1410612406742" width="600" height="450" frameborder="0" style="border:0"></iframe>

Page 78: Laboratorio di Web Design Base - 2014/15 - HTML/5

iFrames

78

Page 79: Laboratorio di Web Design Base - 2014/15 - HTML/5

2014 Giovanni Buffa - CC by-nd 3.0