Html5 semantics

webtechlearningchd 2,997 views 12 slides Feb 23, 2016
Slide 1
Slide 1 of 12
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12

About This Presentation

This Presentation is on the HTML Semantic & Non-Semantic Elements of HTML 5


Slide Content

HTML 5 SEMANTICS & NON-SEMANTIC ELEMENTS

HTML5 Semantic Elements Semantics is the study of the meanings of words and phrases in language . Semantic elements are elements with a meaning.

What are Semantic Elements? A semantic element clearly describes its meaning to both the browser ad 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.

New Semantic Elements in HTML5 HTML5 offers new semantic elements to define different parts of a web page:   <article> < aside> <details> < figcaption > <figure> <footer> <header> <main> <mark> < nav > <section> <summary> <time >

HTML5 <section> Element The <section> element defines a section in a document . "A section is a thematic grouping of content, typically with a heading." <section>   <h1>WWF</h1>   <p>The World Wide Fund for Nature (WWF) is....</p> </section>

HTML5 <article> Element The <article> element specifies independent, self-contained content . An article should make sense on its own, and it should be possible to read it independently from the rest of the web site. <article>   <h1>What Does ARTICLE Do?</h1>   <p>This is the ARTICLE tag in HTML 5.</p> </article>

HTML5 <header> Element The <header> element specifies a header for a document or section . The <header> element should be used as a container for introductory content . You can have several <header> elements in one document. <article>   <header>     <h1>What Does HEADER Tag Do ?</h1>     < p>Headers mission:</p>   </header>   <p>This is Header tag In HTML 5<p> </article>

HTML5 <footer> Element The <footer> element specifies a footer for a document or section . A <footer> element should contain information about its containing element . You can have several <footer> elements in one document. <footer>   <p>Posted by: Hege Refsnes </p>   < p>Contact information : <a  href ="mailto:[email protected]">   [email protected]</a>.</p> </footer>

HTML5 < nav > Element The < nav > element defines a set of navigation links . The < nav > element is intended for large blocks of navigation links. However, not all links in a document should be inside a < nav > element! < nav >   <a  href ="/html/">HTML</a> |   <a  href ="/ css /">CSS</a> |   <a  href ="/ js /">JavaScript</a> |   <a  href ="/ jquery /">jQuery</a> </ nav >

Why Semantic HTML5 Elements? With HTML4, developers used their own favorite attribute names to style page elements : header, top, bottom, footer, menu, navigation, main, container, content, article, sidebar, topnav , ... This made it impossible for search engines to identify the correct web page content.

Why Semantic HTML5 Elements? With HTML5 elements like : <header> <footer> < nav > <section> <article>, this will become easier . "Allows data to be shared and reused across applications, enterprises, and communities."