Aims:
structural, logical, content-based
presentational, physical, appearance, layout, formatting, display, rendering
meaning
html (lang), head, meta, title, link (rel, href), body
h1—h6, p, em, strong, i, b
ul, ol, li
section, nav
a (href)
img (src, title, alt)
figure, figcaption
table, caption, tr
th, td (colspan, rowspan)
< | < |
> | > |
& | & |
Á | Á |
á | á |
€ | € |
< | < |
á | á |
a | a |
Mojito | Margarita | |
---|---|---|
Country | Cuba | Mexico |
Alcohol | Rum | Tequila |
<table> <tr> <th></th> <th>Mojito</th> <th>Margarita</th> </tr> <tr> <th>Country</th> <td>Cuba</td> <td>Mexico</td> </tr> <tr> <th>Alcohol</th> <td>Rum</td> <td>Tequila</td> </tr> </table>
img
and link
), there is never any content—void element
<img src="mojito.jpg" alt="A mojito is packed with mint leaves." />
<p>This is <em>correct</em></p> <p>This is <em>incorrect</p></em>
A student wants to produce this nested list:
But s/he writes this, which is wrong. Please fix it
<ul> <li>badgers</li> <li>wombats</li> <ul> <li>common wombat</li> <li>hairy-nosed wombat</li> </ul> <li>squirrels</li> </ul>
<!-- This is an example comment -->
tree | node |
root | leaf |
parent | child |
ancestor | descendant |
sibling |
<html> <head> <title>A simple document</title> </head> <body> <p> One short paragraph. </p> <p> Another short paragraph with <em>emphasised text.</em> </p> </body> </html>