Semantic Elements in HTML5
A semantic element clearly describes its meaning to both the
browser and the developer.
Examples of non-semantic elements: <div> and <span>
- Tells nothing about its content.
Examples of semantic elements: <form>, <table>,
and <img> - Clearly defines its content.
Many of
existing web sites today contains HTML code like this: <div
id="nav">, <div class="header">, or <div
id="footer">, to indicate navigation links, header, and footer.
HTML5
offers new semantic elements to clearly define different parts of a web page:
- <header>
- <nav>
- <section>
- <article>
- <aside>
- <figcaption>
- <figure>
- <footer>
Semantic Elements in HTML5
Tag
|
Description
|
<article>
|
Defines
an article
|
<aside>
|
Defines
content aside from the page content
|
<figcaption>
|
Defines
a caption for a <figure> element
|
<figure>
|
Specifies
self-contained content, like illustrations, diagrams, photos, code listings,
etc.
|
<footer>
|
Defines
a footer for a document or section
|
<header>
|
Specifies
a header for a document or section
|
<mark>
|
Defines
marked/highlighted text
|
<nav>
|
Defines
navigation links
|
<section>
|
Defines
a section in a document
|
<time>
|
Defines
a date/time
|
Comments
Post a Comment