SlideShare una empresa de Scribd logo
1 de 104
Descargar para leer sin conexión
HTML 
Een opfrissing
1 
De HTML startstructuur
De meest eenvoudige 
HTML startstructuur 
<html> 
<head> 
<title> </title> 
</head> 
<body> 
</body> 
</html>
Een meer uitgebreide, betere 
HTML startstructuur 
<!DOCTYPE html> 
<html lang="nl"> 
<head> 
<title> </title> 
<meta charset="utf-8"> 
</head> 
<body> 
</body> 
</html>
Inclusief link naar externe 
JavaScript en CSS-bestanden 
<!DOCTYPE html> 
<html lang="nl"> 
<head> 
<title></title> 
<meta charset="utf-8" /> 
<link rel="stylesheet" href="layout.css" /> 
<script src="js.js"></script> 
</head> 
<body> 
<!-- Jouw webpagina code --> 
</body> 
</html>
2 
Relaties
S
<h1>Vandaag</h1> 
<p> 
Wat een ongelofelijk 
<em>prachtige</em> 
dag om <abbr>HTML</abbr> 
te leren! 
</p> 
HTML elementen 
staan in relatie met elkaar
3 
Soorten elementen
<h1>Vandaag</h1> 
<p> 
Wat een ongelofelijk 
<em>prachtige</em> 
dag om <abbr>HTML</abbr> 
te leren! 
</p> 
Er zijn inline & block-level 
elementen
Voorbeelden van 
block-level elementen 
<h1> 
<h2> 
<p> 
<ul> 
<li> 
<div> 
<blockquote> 
… 
!
Eigenschappen van 
block-level elementen 
• Worden standaard op een nieuwe 
regel weergegeven 
• Kunnen zowel inline als block-level 
elementen bevatten
<img> 
<em> 
<strong> 
<span> 
<cite> 
<label> 
<i> 
<b> 
… 
! 
Voorbeelden van 
inline elementen
Eigenschappen van inline elementen 
• Worden niet op een nieuwe regel 
weergegeven 
• Kunnen geen block-level 
elementen bevatten 
• Moeten altijd in een block-level 
element zitten
<span> 
<p> 
Why join the navy, if you can 
be a pirate? 
</p> 
</span> 
! 
Zoek de fout—
Zoek de fout— 
<b><h1>Een citaat</h1></b> 
<blockquote> 
<p> 
Stay hungry, stay 
<em>foolish</em>. 
</p> 
<cite>—Steve Jobs</cite> 
</blockquote> 
!
Zoek de fout— 
<h1>Leer de regels</h1> 
<p>Dan weet je tenminste wanneer je 
ze kan overtreden.</p> 
<img src="b.png" alt="beethoven"> 
!
“de uitzondering die 
de regel bevestigt”
<a> 
“Het blijft een inline element, maar je 
kan er nu ook block-level elementen in 
plaatsen.” 
—W3C HTML5 specification
HTML4 
<h1><a>Artikel titel</a></h1> 
<p><a><img></a></p> 
<p><a>Eerste alinea</a></p> 
<p><a>Lees meer »</a></p>
<a> 
<h1>Artikel titel</h1> 
<p><img></p> 
<p>Eerste alinea</p> 
<p>Lees meer »</p> 
</a> 
HTML5
4 
Dubbel & enkelvoudig
<h1>Contactgegevens</h1> 
<p> 
Het Perspectief<br> 
Henleykaai 83<br> 
9000 Gent 
</p> 
<p> 
<img src="hp.png" alt="School"> 
</p> 
Er zijn dubbele & 
enkelvoudige elementen
5 
Blijf consequent in syntax
<H1>Syntaxregels</H1> 
<P> 
Jantje zag eens pruimen hangen,<BR> 
O!<br /> als eieren zo groot 
</p> 
<p class=beeldje> 
<img src=jan.jpg alt="jantje"> 
</P> 
! 
Correcte HTML, 
maar niet echt consequent
<h1>Syntaxregels</h1> 
<p> 
Jantje zag eens pruimen hangen,<br> 
O!<br> als eieren zo groot 
</p> 
<p class="beeldje"> 
<img src="jan.jpg" alt="jantje"> 
</p> 
! 
Kies een striktere stijl, 
gebaseerd op de XHTML syntax
<br> 
! 
Beide correct in HTML5— 
kies en blijf consequent 
<br /> 
!
Beide correct in HTML5— 
kies en blijf consequent 
<img src="i.jpg" alt="koe"> 
! 
<img src="i.jpg" alt="koe" /> 
!
6 
Vermijd verouderde HTML
Flashback: voorbeelden van 
verouderde elementen 
<font> 
<center> 
<strike> 
<u> 
… 
!
Flashback: voorbeelden van 
verouderde attributen 
align="left" 
background="f.jpg" 
bgcolor="red" 
border="0" 
nowrap 
… 
!
Oude elementen met 
vernieuwde betekenis 
in HTML5
<b> 
“Tekst die anders moet worden 
weergegeven dan de gewone tekst, 
zonder extra nadruk mee te geven.” 
—W3C HTML5 specification
<i> 
“Tekst die in een andere stem of sfeer 
moet worden gelezen dan de gewone 
tekst, zonder extra nadruk mee 
te geven.” 
—W3C HTML5 specification
<small> 
“Tekst die ‘de kleine lettertjes’ voorstelt: 
copyrightinformatie, algemene 
voorwaarden, legale verplichtingen…” 
—W3C HTML5 specification
7 
Schrijf semantische HTML
Ken je deze (nieuwere) elementen al? 
Ze maken je HTML semantischer.
<time> 
“Om data, tijdstippen of beide 
aan te duiden.” 
—W3C HTML5 specification
<p> 
Kom eens langs op 
<time datetime="2015-04-07"> 
7 april</time>. 
</p> 
<time>
<p> 
De staking vond plaats in 
<time datetime="1933-11">november 
</time> van dat jaar. 
</p> 
<time>
<p> 
Op <time datetime="01-01"> 
1 januari</time> zijn we 
gesloten. 
</p> 
<time>
<p> 
Ik ben geboren in 
<time datetime="1980">1980 
</time>. 
</p> 
<time>
<p> 
Het wonder vond plaats op 
<time datetime="2012-06-13 20:18"> 
13 juni 2012</time>. 
</p> 
<time>
<section> 
“Om inhoudelijk gerelateerde zaken 
te groeperen.” 
—W3C HTML5 specification
<section> 
<section> 
<h1>HTML5</h1> 
<p>HTML5 is de toekomst.</p> 
<p>Er is geen weg terug.</p> 
<p><img src="i.jpg" alt=""></p> 
</section>
<article> 
“Om inhoudelijk gerelateerde zaken 
te groeperen. De inhoud blijft duidelijk 
als die uit de context van de website 
gehaald zou worden (bijv. in een 
RSS-lezer).” 
—W3C HTML5 specification
<article> vs <section> 
• Beide hebben in principe een titel (heading). 
• article is een speciale vorm van section: het 
heeft meer semantische betekenis: een 
onafhankelijk, op-zich-staand stukje inhoud. 
• Gebruik article als je de inhoud naar een vriend 
kan e-mailen: het houdt nog steeds steek buiten de 
context van de website. 
• Het houdt geen steek buiten de context van de site, 
maar de inhoud is gerelateerd? Gebruik section. 
• De inhoud is niet gerelateerd? Gebruik div.
<header> 
“Bevat een groep inleidende of 
navigatie-elementen voor het element 
waarin header zich bevindt. Ook logo’s 
of zoekvelden zijn mogelijke inhoud.” 
—W3C HTML5 specification
<body> 
<header> 
(logo en navigatie) 
</header> 
(rest van de pagina) 
</body> 
<header>
<section> 
<header> 
<header> 
<p>Een introductie tot…</p> 
<h1>Moestuinieren</h1> 
</header> 
<p> 
Elke lente begint het weer te 
kriebelen. 
</p> 
</section>
<footer> 
“Bevat meer informatie over het 
element waarin footer zich bevindt: 
auteur, copyrightinformatie, links naar 
gerelateerde informatie…” 
—W3C HTML5 specification
<body> 
<header> 
(logo en navigatie) 
</header> 
(rest van de pagina) 
<footer> 
(copyrightinfo, contactinfo…) 
</footer> 
</body> 
<footer>
<section> 
<footer> 
<header> 
<h1>Moestuinieren</h1> 
</header> 
<p>Elke lente begint het weer te 
kriebelen.</p> 
<footer> 
<p>Auteur: Thomas Byttebier</p> 
</footer> 
</section>
<main> 
“Bevat de belangrijkste content van de 
body van een webpagina. Het kan 
daarom maar 1 keer voorkomen op een 
pagina.” 
—W3C HTML5 specification
<main> 
“Bevat content die uniek is voor de 
pagina, en bevat vooral geen content 
die herhaald wordt doorheen een set 
van pagina’s: site-navigatie, 
copyrightinfo, logo’s…” 
—W3C HTML5 specification
<main> 
“Het main element mag geen nakomeling 
zijn van een article, aside, footer, 
header of nav element.” 
—W3C HTML5 specification
<body> 
<header> 
(logo en navigatie) 
</header> 
<main> 
(belangrijkste content) 
</main> 
<footer> 
(copyrightinfo, contactinfo…) 
</footer> 
</body> 
<main>
<!-- other content --> 
! 
<main> 
<h1>Skateboards</h1> 
<p>The skateboard is the way cool kids get around</p> 
<article> 
<h2>Longboards</h2> 
<p>Longboards are a type of skateboard with a longer 
wheelbase and larger, softer wheels.</p> 
<p>... </p> 
</article> 
! 
<article> 
<h2>Electric Skateboards</h2> 
<p>These no longer require the propelling of the 
skateboard by means of the feet; rather an electric 
motor propels the board, fed by a battery.</p> 
<p>... </p> 
</article> 
</main> 
! 
<!-- other content -->
<aside> 
“Bevat informatie die zijdelings 
gerelateerd is aan de inhoud rond het 
aside element, en die als aparte content 
gezien kan worden: pull quotes, 
zijkolommen, reclame, navigatie…” 
—W3C HTML5 specification
<nav> 
“Bevat belangrijke navigatielinks.” 
—W3C HTML5 specification
<body> 
<header> 
(logo) 
<nav>(unordered list)</nav> 
</header> 
<main> 
(belangrijkste content) 
</main> 
<aside> 
(zijinformatie) 
</aside> 
<footer> 
(copyrightinfo, contactinfo…) 
</footer> 
</body> 
<nav>
<figure> 
“Bevat een op zich staand beeld: foto, 
video, illustratie… (optioneel) met een 
onderschrift. ” 
—W3C HTML5 specification
<figcaption> 
“Bevat het onderschrift van een figure.” 
—W3C HTML5 specification
<figure> 
<img src="o.jpg" alt="twee meisjes"> 
<figcaption> 
Twee meisjes op het strand van 
Oostduinkerke. Ze lezen 
modebladen. 
</figcaption> 
</figure> 
<figure>
<figure> 
<img src="d.jpg" alt="diagram"> 
<figcaption> 
Het aantal nieuwe leden per jaar. 
</figcaption> 
</figure> 
<figure>
<figure> 
<img src="d.jpg" alt=“diagram 10"> 
<img src="d2.jpg" alt=“diagram 11"> 
<img src="d3.jpg" alt=“diagram 12"> 
<figcaption> 
Het aantal nieuwe leden per jaar. 
</figcaption> 
</figure> 
<figure>
Bron: html5doctor.com
Eenvoudig advies: gebruik enkel 
figure wanneer je beeld ook een 
onderschrift (figcaption) heeft.
Deze nieuwere elementen zijn 
bruikbaar, mits een regel CSS: 
article, aside, figure, figcaption, 
footer, header, main, nav, section 
{ display:block; }
Internet Explorer < 9 heeft ook wat 
javascript nodig: de HTML5 shiv
Voeg ze toe aan je startstructuur: 
nieuwere elementen in elke browser 
<!--[if lt IE 9]> 
<script src=“http:// 
html5shiv.googlecode.com/svn/trunk/ 
html5.js"></script> 
<![endif]--> 
<style> 
article, aside, figure, figcaption, 
footer, header, main, nav, section 
{ display:block; } 
</style>
<!DOCTYPE html> 
<html lang="nl"> 
<head> 
<title></title> 
<meta charset="utf-8" /> 
<!--[if lt IE 9]> 
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> 
<![endif]--> 
<style> 
article, aside, figure, figcaption, footer, header, main, nav, 
section { display:block; } 
</style> 
<link rel="stylesheet" href="css/screen.css" /> 
<script src="js/js.js"></script> 
</head> 
<body> 
</body> 
</html> 
De allesomvattende 
HTML5 startstructuur
De nieuwe document outline 
van HTML5
“The document outline is the structure 
of a document, generated by the 
document’s headings, form titles, table 
titles, and any other appropriate 
landmarks to map out the document. 
The user agent can apply this 
information to generate a table of 
contents, for example.” 
—HTML5doctor.com
De document outline van HTML4 
<h1>Altijd de belangrijkste kop van de 
volledige pagina</h1> 
<h2>Nieuwsitem</h2> 
<p>Tekst</p> 
<h3>Subkop</h3> 
<p>Tekst</p> 
<h3>Subkop</h3> 
<p>Tekst</p> 
...
De document outline van HTML5 
<h1>Belangrijkste kop van de volledige 
pagina</h1> 
<article> 
<h1>Belangrijkste kop van article</h1> 
<p>Tekst</p> 
<h2>Subkop van article</h2> 
<p>Tekst</p> 
<h2>Subkop van article</h2> 
<p>Tekst</p> 
</article>
“There are currently no known implementations 
of the outline algorithm in graphical browsers 
or assistive technology user agents, although 
the algorithm is implemented in other software 
such as conformance checkers. Therefore the 
outline algorithm cannot be relied upon to 
convey document structure to users. 
Authors are advised to use heading rank 
(h1-h6) to convey document structure.” 
—W3C HTML5 specification
Meer weten? Nalezen?
That’s it!
Onthou je het vorige, dan rest je enkel: 
• Leer de elementen kennen (lijst) 
• Zijn ze block-level of inline? 
• Valideer je syntax 
• Redeneer logisch om te bepalen 
welk element het best bepaalde 
inhoud kan weergeven
And that’s really it!

Más contenido relacionado

Destacado

Scsu91908017
Scsu91908017Scsu91908017
Scsu91908017SAPHOTO
 
Enfermedad moral en la salud publica
Enfermedad moral en la salud publicaEnfermedad moral en la salud publica
Enfermedad moral en la salud publicaMemo Muñoz
 
인천오피DASOM12net서현오피@야탑오피@동탄오피
인천오피DASOM12net서현오피@야탑오피@동탄오피인천오피DASOM12net서현오피@야탑오피@동탄오피
인천오피DASOM12net서현오피@야탑오피@동탄오피egvuubww2
 
Scsu91908018
Scsu91908018Scsu91908018
Scsu91908018SAPHOTO
 
Kevin Tyra
Kevin TyraKevin Tyra
Kevin Tyracopybob
 
Step by step guide to switch ip address of 2 domain controllers
Step by step guide to switch ip address of 2 domain controllersStep by step guide to switch ip address of 2 domain controllers
Step by step guide to switch ip address of 2 domain controllersNilesh Kamble
 
Connecting users to the tools that have been created for them
Connecting users to the tools that have been created for themConnecting users to the tools that have been created for them
Connecting users to the tools that have been created for themSamantha Levin
 
Tabletas Android en la Educacion
Tabletas Android en la EducacionTabletas Android en la Educacion
Tabletas Android en la EducacionBoris Sanchez
 
CALM not BUSY: A New Approach for Nonprofit Communications Directors to Do Th...
CALM not BUSY: A New Approach for Nonprofit Communications Directors to Do Th...CALM not BUSY: A New Approach for Nonprofit Communications Directors to Do Th...
CALM not BUSY: A New Approach for Nonprofit Communications Directors to Do Th...Kivi Leroux Miller
 

Destacado (14)

Scsu91908017
Scsu91908017Scsu91908017
Scsu91908017
 
Enfermedad moral en la salud publica
Enfermedad moral en la salud publicaEnfermedad moral en la salud publica
Enfermedad moral en la salud publica
 
인천오피DASOM12net서현오피@야탑오피@동탄오피
인천오피DASOM12net서현오피@야탑오피@동탄오피인천오피DASOM12net서현오피@야탑오피@동탄오피
인천오피DASOM12net서현오피@야탑오피@동탄오피
 
Scsu91908018
Scsu91908018Scsu91908018
Scsu91908018
 
Kevin Tyra
Kevin TyraKevin Tyra
Kevin Tyra
 
CV PDF
CV PDFCV PDF
CV PDF
 
Step by step guide to switch ip address of 2 domain controllers
Step by step guide to switch ip address of 2 domain controllersStep by step guide to switch ip address of 2 domain controllers
Step by step guide to switch ip address of 2 domain controllers
 
Chap22 28
Chap22 28Chap22 28
Chap22 28
 
Connecting users to the tools that have been created for them
Connecting users to the tools that have been created for themConnecting users to the tools that have been created for them
Connecting users to the tools that have been created for them
 
G1manual
G1manualG1manual
G1manual
 
AIP UO - Rejestracja działalności gospodarczej
AIP UO - Rejestracja działalności gospodarczejAIP UO - Rejestracja działalności gospodarczej
AIP UO - Rejestracja działalności gospodarczej
 
Clean Code - A&BP CC
Clean Code - A&BP CCClean Code - A&BP CC
Clean Code - A&BP CC
 
Tabletas Android en la Educacion
Tabletas Android en la EducacionTabletas Android en la Educacion
Tabletas Android en la Educacion
 
CALM not BUSY: A New Approach for Nonprofit Communications Directors to Do Th...
CALM not BUSY: A New Approach for Nonprofit Communications Directors to Do Th...CALM not BUSY: A New Approach for Nonprofit Communications Directors to Do Th...
CALM not BUSY: A New Approach for Nonprofit Communications Directors to Do Th...
 

Similar a HTML opfrissing

Magento cursus: theme opzetten & beheren
Magento cursus: theme opzetten & beherenMagento cursus: theme opzetten & beheren
Magento cursus: theme opzetten & beherenMichel Doens
 
Html5 jeugdwerknet
Html5 jeugdwerknetHtml5 jeugdwerknet
Html5 jeugdwerknetHans Rossel
 
Tutorial html en css
Tutorial html en cssTutorial html en css
Tutorial html en cssJohan Smits
 
Presentatie bij de training HTML5 die plaatsvond na afloop van de sessie Mico...
Presentatie bij de training HTML5 die plaatsvond na afloop van de sessie Mico...Presentatie bij de training HTML5 die plaatsvond na afloop van de sessie Mico...
Presentatie bij de training HTML5 die plaatsvond na afloop van de sessie Mico...SLBdiensten
 
Best Practice: Joomla! templating
Best Practice: Joomla! templatingBest Practice: Joomla! templating
Best Practice: Joomla! templatingHans Kuijpers
 
Maximale impact met woorden online
Maximale impact met woorden onlineMaximale impact met woorden online
Maximale impact met woorden onlineBart De Waele
 
Joomla! Plugins Programmeren [NL]
Joomla! Plugins Programmeren [NL]Joomla! Plugins Programmeren [NL]
Joomla! Plugins Programmeren [NL]Yireo
 
Intro schema.org / microdata voor frontend developers
Intro schema.org / microdata voor frontend developersIntro schema.org / microdata voor frontend developers
Intro schema.org / microdata voor frontend developersPieter Mergan
 
How to create a Drupal theme (Dut
How to create a Drupal theme (DutHow to create a Drupal theme (Dut
How to create a Drupal theme (DutN digital studio
 

Similar a HTML opfrissing (19)

HTML kort & bondig
HTML kort & bondigHTML kort & bondig
HTML kort & bondig
 
Eduvision - Webinar html5 css3
Eduvision - Webinar html5 css3Eduvision - Webinar html5 css3
Eduvision - Webinar html5 css3
 
Presentatie webrichtlijnen
Presentatie webrichtlijnenPresentatie webrichtlijnen
Presentatie webrichtlijnen
 
Magento cursus: theme opzetten & beheren
Magento cursus: theme opzetten & beherenMagento cursus: theme opzetten & beheren
Magento cursus: theme opzetten & beheren
 
Html5 jeugdwerknet
Html5 jeugdwerknetHtml5 jeugdwerknet
Html5 jeugdwerknet
 
Tutorial html en css
Tutorial html en cssTutorial html en css
Tutorial html en css
 
Presentatie bij de training HTML5 die plaatsvond na afloop van de sessie Mico...
Presentatie bij de training HTML5 die plaatsvond na afloop van de sessie Mico...Presentatie bij de training HTML5 die plaatsvond na afloop van de sessie Mico...
Presentatie bij de training HTML5 die plaatsvond na afloop van de sessie Mico...
 
Refresher HTML(5) and CSS(3) - CC FE & UX
Refresher HTML(5) and CSS(3) - CC FE & UXRefresher HTML(5) and CSS(3) - CC FE & UX
Refresher HTML(5) and CSS(3) - CC FE & UX
 
Best Practice: Joomla! templating
Best Practice: Joomla! templatingBest Practice: Joomla! templating
Best Practice: Joomla! templating
 
Wdreader1
Wdreader1Wdreader1
Wdreader1
 
Les01 Htmlen Xhtml2008
Les01 Htmlen Xhtml2008Les01 Htmlen Xhtml2008
Les01 Htmlen Xhtml2008
 
Les 1
Les 1Les 1
Les 1
 
Basiscursus webdesign
Basiscursus webdesignBasiscursus webdesign
Basiscursus webdesign
 
Maximale impact met woorden online
Maximale impact met woorden onlineMaximale impact met woorden online
Maximale impact met woorden online
 
Joomla! Plugins Programmeren [NL]
Joomla! Plugins Programmeren [NL]Joomla! Plugins Programmeren [NL]
Joomla! Plugins Programmeren [NL]
 
Speeding up WordPress
Speeding up WordPressSpeeding up WordPress
Speeding up WordPress
 
Intro schema.org / microdata voor frontend developers
Intro schema.org / microdata voor frontend developersIntro schema.org / microdata voor frontend developers
Intro schema.org / microdata voor frontend developers
 
How to create a Drupal theme (Dut
How to create a Drupal theme (DutHow to create a Drupal theme (Dut
How to create a Drupal theme (Dut
 
Logeion2007
Logeion2007Logeion2007
Logeion2007
 

Más de Thomas Byttebier

Characteristics of a well designed user interface
Characteristics of a well designed user interfaceCharacteristics of a well designed user interface
Characteristics of a well designed user interfaceThomas Byttebier
 
Toegankelijke en semantische HTML formulieren
Toegankelijke en semantische HTML formulierenToegankelijke en semantische HTML formulieren
Toegankelijke en semantische HTML formulierenThomas Byttebier
 
CSS3 kleuren en border-radius
CSS3 kleuren en border-radiusCSS3 kleuren en border-radius
CSS3 kleuren en border-radiusThomas Byttebier
 
Belangrijke CSS begrippen (2)
Belangrijke CSS begrippen (2)Belangrijke CSS begrippen (2)
Belangrijke CSS begrippen (2)Thomas Byttebier
 

Más de Thomas Byttebier (9)

Characteristics of a well designed user interface
Characteristics of a well designed user interfaceCharacteristics of a well designed user interface
Characteristics of a well designed user interface
 
Toegankelijke en semantische HTML formulieren
Toegankelijke en semantische HTML formulierenToegankelijke en semantische HTML formulieren
Toegankelijke en semantische HTML formulieren
 
Fluid video en audio
Fluid video en audioFluid video en audio
Fluid video en audio
 
CSS positionering
CSS positioneringCSS positionering
CSS positionering
 
CSS3 kleuren en border-radius
CSS3 kleuren en border-radiusCSS3 kleuren en border-radius
CSS3 kleuren en border-radius
 
Reset normalize CSS
Reset normalize CSSReset normalize CSS
Reset normalize CSS
 
Belangrijke CSS begrippen (2)
Belangrijke CSS begrippen (2)Belangrijke CSS begrippen (2)
Belangrijke CSS begrippen (2)
 
CSS basis
CSS basisCSS basis
CSS basis
 
Webdesign 2: introductie
Webdesign 2: introductieWebdesign 2: introductie
Webdesign 2: introductie
 

HTML opfrissing

  • 2. 1 De HTML startstructuur
  • 3. De meest eenvoudige HTML startstructuur <html> <head> <title> </title> </head> <body> </body> </html>
  • 4. Een meer uitgebreide, betere HTML startstructuur <!DOCTYPE html> <html lang="nl"> <head> <title> </title> <meta charset="utf-8"> </head> <body> </body> </html>
  • 5. Inclusief link naar externe JavaScript en CSS-bestanden <!DOCTYPE html> <html lang="nl"> <head> <title></title> <meta charset="utf-8" /> <link rel="stylesheet" href="layout.css" /> <script src="js.js"></script> </head> <body> <!-- Jouw webpagina code --> </body> </html>
  • 7. S
  • 8. <h1>Vandaag</h1> <p> Wat een ongelofelijk <em>prachtige</em> dag om <abbr>HTML</abbr> te leren! </p> HTML elementen staan in relatie met elkaar
  • 10. <h1>Vandaag</h1> <p> Wat een ongelofelijk <em>prachtige</em> dag om <abbr>HTML</abbr> te leren! </p> Er zijn inline & block-level elementen
  • 11. Voorbeelden van block-level elementen <h1> <h2> <p> <ul> <li> <div> <blockquote> … !
  • 12. Eigenschappen van block-level elementen • Worden standaard op een nieuwe regel weergegeven • Kunnen zowel inline als block-level elementen bevatten
  • 13. <img> <em> <strong> <span> <cite> <label> <i> <b> … ! Voorbeelden van inline elementen
  • 14. Eigenschappen van inline elementen • Worden niet op een nieuwe regel weergegeven • Kunnen geen block-level elementen bevatten • Moeten altijd in een block-level element zitten
  • 15. <span> <p> Why join the navy, if you can be a pirate? </p> </span> ! Zoek de fout—
  • 16. Zoek de fout— <b><h1>Een citaat</h1></b> <blockquote> <p> Stay hungry, stay <em>foolish</em>. </p> <cite>—Steve Jobs</cite> </blockquote> !
  • 17. Zoek de fout— <h1>Leer de regels</h1> <p>Dan weet je tenminste wanneer je ze kan overtreden.</p> <img src="b.png" alt="beethoven"> !
  • 18. “de uitzondering die de regel bevestigt”
  • 19. <a> “Het blijft een inline element, maar je kan er nu ook block-level elementen in plaatsen.” —W3C HTML5 specification
  • 20.
  • 21.
  • 22. HTML4 <h1><a>Artikel titel</a></h1> <p><a><img></a></p> <p><a>Eerste alinea</a></p> <p><a>Lees meer »</a></p>
  • 23. <a> <h1>Artikel titel</h1> <p><img></p> <p>Eerste alinea</p> <p>Lees meer »</p> </a> HTML5
  • 24. 4 Dubbel & enkelvoudig
  • 25. <h1>Contactgegevens</h1> <p> Het Perspectief<br> Henleykaai 83<br> 9000 Gent </p> <p> <img src="hp.png" alt="School"> </p> Er zijn dubbele & enkelvoudige elementen
  • 26. 5 Blijf consequent in syntax
  • 27. <H1>Syntaxregels</H1> <P> Jantje zag eens pruimen hangen,<BR> O!<br /> als eieren zo groot </p> <p class=beeldje> <img src=jan.jpg alt="jantje"> </P> ! Correcte HTML, maar niet echt consequent
  • 28. <h1>Syntaxregels</h1> <p> Jantje zag eens pruimen hangen,<br> O!<br> als eieren zo groot </p> <p class="beeldje"> <img src="jan.jpg" alt="jantje"> </p> ! Kies een striktere stijl, gebaseerd op de XHTML syntax
  • 29. <br> ! Beide correct in HTML5— kies en blijf consequent <br /> !
  • 30. Beide correct in HTML5— kies en blijf consequent <img src="i.jpg" alt="koe"> ! <img src="i.jpg" alt="koe" /> !
  • 32. Flashback: voorbeelden van verouderde elementen <font> <center> <strike> <u> … !
  • 33. Flashback: voorbeelden van verouderde attributen align="left" background="f.jpg" bgcolor="red" border="0" nowrap … !
  • 34. Oude elementen met vernieuwde betekenis in HTML5
  • 35. <b> “Tekst die anders moet worden weergegeven dan de gewone tekst, zonder extra nadruk mee te geven.” —W3C HTML5 specification
  • 36.
  • 37. <i> “Tekst die in een andere stem of sfeer moet worden gelezen dan de gewone tekst, zonder extra nadruk mee te geven.” —W3C HTML5 specification
  • 38.
  • 39.
  • 40. <small> “Tekst die ‘de kleine lettertjes’ voorstelt: copyrightinformatie, algemene voorwaarden, legale verplichtingen…” —W3C HTML5 specification
  • 41.
  • 42.
  • 44. Ken je deze (nieuwere) elementen al? Ze maken je HTML semantischer.
  • 45. <time> “Om data, tijdstippen of beide aan te duiden.” —W3C HTML5 specification
  • 46. <p> Kom eens langs op <time datetime="2015-04-07"> 7 april</time>. </p> <time>
  • 47. <p> De staking vond plaats in <time datetime="1933-11">november </time> van dat jaar. </p> <time>
  • 48. <p> Op <time datetime="01-01"> 1 januari</time> zijn we gesloten. </p> <time>
  • 49. <p> Ik ben geboren in <time datetime="1980">1980 </time>. </p> <time>
  • 50. <p> Het wonder vond plaats op <time datetime="2012-06-13 20:18"> 13 juni 2012</time>. </p> <time>
  • 51.
  • 52.
  • 53. <section> “Om inhoudelijk gerelateerde zaken te groeperen.” —W3C HTML5 specification
  • 54. <section> <section> <h1>HTML5</h1> <p>HTML5 is de toekomst.</p> <p>Er is geen weg terug.</p> <p><img src="i.jpg" alt=""></p> </section>
  • 55. <article> “Om inhoudelijk gerelateerde zaken te groeperen. De inhoud blijft duidelijk als die uit de context van de website gehaald zou worden (bijv. in een RSS-lezer).” —W3C HTML5 specification
  • 56.
  • 57.
  • 58. <article> vs <section> • Beide hebben in principe een titel (heading). • article is een speciale vorm van section: het heeft meer semantische betekenis: een onafhankelijk, op-zich-staand stukje inhoud. • Gebruik article als je de inhoud naar een vriend kan e-mailen: het houdt nog steeds steek buiten de context van de website. • Het houdt geen steek buiten de context van de site, maar de inhoud is gerelateerd? Gebruik section. • De inhoud is niet gerelateerd? Gebruik div.
  • 59.
  • 60.
  • 61.
  • 62. <header> “Bevat een groep inleidende of navigatie-elementen voor het element waarin header zich bevindt. Ook logo’s of zoekvelden zijn mogelijke inhoud.” —W3C HTML5 specification
  • 63. <body> <header> (logo en navigatie) </header> (rest van de pagina) </body> <header>
  • 64.
  • 65. <section> <header> <header> <p>Een introductie tot…</p> <h1>Moestuinieren</h1> </header> <p> Elke lente begint het weer te kriebelen. </p> </section>
  • 66. <footer> “Bevat meer informatie over het element waarin footer zich bevindt: auteur, copyrightinformatie, links naar gerelateerde informatie…” —W3C HTML5 specification
  • 67. <body> <header> (logo en navigatie) </header> (rest van de pagina) <footer> (copyrightinfo, contactinfo…) </footer> </body> <footer>
  • 68.
  • 69. <section> <footer> <header> <h1>Moestuinieren</h1> </header> <p>Elke lente begint het weer te kriebelen.</p> <footer> <p>Auteur: Thomas Byttebier</p> </footer> </section>
  • 70. <main> “Bevat de belangrijkste content van de body van een webpagina. Het kan daarom maar 1 keer voorkomen op een pagina.” —W3C HTML5 specification
  • 71. <main> “Bevat content die uniek is voor de pagina, en bevat vooral geen content die herhaald wordt doorheen een set van pagina’s: site-navigatie, copyrightinfo, logo’s…” —W3C HTML5 specification
  • 72. <main> “Het main element mag geen nakomeling zijn van een article, aside, footer, header of nav element.” —W3C HTML5 specification
  • 73. <body> <header> (logo en navigatie) </header> <main> (belangrijkste content) </main> <footer> (copyrightinfo, contactinfo…) </footer> </body> <main>
  • 74. <!-- other content --> ! <main> <h1>Skateboards</h1> <p>The skateboard is the way cool kids get around</p> <article> <h2>Longboards</h2> <p>Longboards are a type of skateboard with a longer wheelbase and larger, softer wheels.</p> <p>... </p> </article> ! <article> <h2>Electric Skateboards</h2> <p>These no longer require the propelling of the skateboard by means of the feet; rather an electric motor propels the board, fed by a battery.</p> <p>... </p> </article> </main> ! <!-- other content -->
  • 75.
  • 76.
  • 77.
  • 78. <aside> “Bevat informatie die zijdelings gerelateerd is aan de inhoud rond het aside element, en die als aparte content gezien kan worden: pull quotes, zijkolommen, reclame, navigatie…” —W3C HTML5 specification
  • 79.
  • 80.
  • 81. <nav> “Bevat belangrijke navigatielinks.” —W3C HTML5 specification
  • 82. <body> <header> (logo) <nav>(unordered list)</nav> </header> <main> (belangrijkste content) </main> <aside> (zijinformatie) </aside> <footer> (copyrightinfo, contactinfo…) </footer> </body> <nav>
  • 83.
  • 84. <figure> “Bevat een op zich staand beeld: foto, video, illustratie… (optioneel) met een onderschrift. ” —W3C HTML5 specification
  • 85. <figcaption> “Bevat het onderschrift van een figure.” —W3C HTML5 specification
  • 86. <figure> <img src="o.jpg" alt="twee meisjes"> <figcaption> Twee meisjes op het strand van Oostduinkerke. Ze lezen modebladen. </figcaption> </figure> <figure>
  • 87. <figure> <img src="d.jpg" alt="diagram"> <figcaption> Het aantal nieuwe leden per jaar. </figcaption> </figure> <figure>
  • 88. <figure> <img src="d.jpg" alt=“diagram 10"> <img src="d2.jpg" alt=“diagram 11"> <img src="d3.jpg" alt=“diagram 12"> <figcaption> Het aantal nieuwe leden per jaar. </figcaption> </figure> <figure>
  • 90. Eenvoudig advies: gebruik enkel figure wanneer je beeld ook een onderschrift (figcaption) heeft.
  • 91. Deze nieuwere elementen zijn bruikbaar, mits een regel CSS: article, aside, figure, figcaption, footer, header, main, nav, section { display:block; }
  • 92. Internet Explorer < 9 heeft ook wat javascript nodig: de HTML5 shiv
  • 93. Voeg ze toe aan je startstructuur: nieuwere elementen in elke browser <!--[if lt IE 9]> <script src=“http:// html5shiv.googlecode.com/svn/trunk/ html5.js"></script> <![endif]--> <style> article, aside, figure, figcaption, footer, header, main, nav, section { display:block; } </style>
  • 94. <!DOCTYPE html> <html lang="nl"> <head> <title></title> <meta charset="utf-8" /> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <style> article, aside, figure, figcaption, footer, header, main, nav, section { display:block; } </style> <link rel="stylesheet" href="css/screen.css" /> <script src="js/js.js"></script> </head> <body> </body> </html> De allesomvattende HTML5 startstructuur
  • 95. De nieuwe document outline van HTML5
  • 96. “The document outline is the structure of a document, generated by the document’s headings, form titles, table titles, and any other appropriate landmarks to map out the document. The user agent can apply this information to generate a table of contents, for example.” —HTML5doctor.com
  • 97. De document outline van HTML4 <h1>Altijd de belangrijkste kop van de volledige pagina</h1> <h2>Nieuwsitem</h2> <p>Tekst</p> <h3>Subkop</h3> <p>Tekst</p> <h3>Subkop</h3> <p>Tekst</p> ...
  • 98. De document outline van HTML5 <h1>Belangrijkste kop van de volledige pagina</h1> <article> <h1>Belangrijkste kop van article</h1> <p>Tekst</p> <h2>Subkop van article</h2> <p>Tekst</p> <h2>Subkop van article</h2> <p>Tekst</p> </article>
  • 99. “There are currently no known implementations of the outline algorithm in graphical browsers or assistive technology user agents, although the algorithm is implemented in other software such as conformance checkers. Therefore the outline algorithm cannot be relied upon to convey document structure to users. Authors are advised to use heading rank (h1-h6) to convey document structure.” —W3C HTML5 specification
  • 100.
  • 103. Onthou je het vorige, dan rest je enkel: • Leer de elementen kennen (lijst) • Zijn ze block-level of inline? • Valideer je syntax • Redeneer logisch om te bepalen welk element het best bepaalde inhoud kan weergeven