SlideShare a Scribd company logo
1 of 33
Download to read offline
SEMANTIC
                          HTML5 101
                          or “Bye bye divitis”


                          Pascal Rettig
                          On Twitter @cykod




Wednesday, May 25, 2011
Born in 1989 by Tim Berner’s Lee




          HTML IS IN TO ITee EA
                          ’S    RLY 20’S
           Born in 1989 by Tim Berner’s L

Wednesday, May 25, 2011
LI FE CRniSgI”S
                  QUAR3TERing to find “Mea n  I
      FACINlGr A ML5 & Web .0 is try
            fo HT
       The big goa

Wednesday, May 25, 2011
WHAT IS A
                          “SEMANTIC CHOP”?
                          A way to give structure and meaning to the
                          HTML that you generate.




Wednesday, May 25, 2011
W HO IS TH IS FOR?
                     •    Primarily clients other than
                          your usual Web Browsers.

                     •    The Google, Other Search
                          Engines, Data Aggregators,
                          Screen Readers, “Non-
                          traditional” browsers




Wednesday, May 25, 2011
THE GOALS
                          •   HTML tags used in Meaningful
                              ways
                          •   All styling information left to CSS
                          •   Validating markup
                          •   All dynamic interactions added
                              “unobtrusively” (usually via
                              jQuery)




Wednesday, May 25, 2011
HOW DOES
                          HTML5 ACHIEVE
                          THIS?


Wednesday, May 25, 2011
#1 A BOATLOAD OF
                             MEANINGFUL TAGS.
                             <article> <aside> <audio> <canvas>
                             <command> <datalist> <details>
                             <embed> <figcaption> <figure> <footer>
                             <header> <hgroup> <keygen> <mark>
                             <meter> <nav> <output> <progress>
                             <rp> <rt> <ruby> <section> <source>
                             <summary> <time> <video> <wbr>
                             http://www.w3schools.com/html5/
                             tag_wbr.asp




Wednesday, May 25, 2011
#2SECTIONING
                            TAGS
                            <article>
                            <aside>
                            <nav>
                            <section>
                            (Also <details> <figure> act as the
                            same, but don’t add to the parent
                            section)




Wednesday, May 25, 2011
EACH CREATES A
                          NEW “SECTION” OF
                          YOUR PAGE
                          Each of these represents a separate line in
                          the outline of your document.




Wednesday, May 25, 2011
#3ORGANIZATIONAL
                             ELEMENTS
                             <header>
                             <footer>
                             <hgroup>




Wednesday, May 25, 2011
CAN BE USED TO
                          GROUP CONTENT
                          TOGETHER
                          (But does not create a separate sectioning
                          root)




Wednesday, May 25, 2011
#4SELF-CONTAINED
                             “SYNDICATABLE”
                             CONTENT
                             All <article>’s should be self-contained
                             elements
                             They can contain their own <h1>’s
                             <header>’s <footer>’s etc




Wednesday, May 25, 2011
#5ADDED MEANING
                            TO HTML5 TAGS
                            <em>Emphasized text</em>
                            <strong>Strong text</strong>
                            <dfn>Definition term</dfn>
                            <code>Computer code text</code>
                            <samp>Sample computer code text</samp>
                            <kbd>Keyboard text</kbd>
                            <var>Variable</var>
                            <cite>Citation</cite>




Wednesday, May 25, 2011
E XAMPLE:
                          <!DOCTYPE html>
                          <html>
                          <head>
                             ... Head Stuff ..
                          </head>
                          <body>
                            <header>
                              <h1>My Website</h1>
                              <nav id=‘main-menu’>
                                 <h1>Main Menu</h1>
                                 <ul>
                                      <li><a href=’#’>Item 1</a></li>
                                      <li><a href=’#’>Item 2</a></li>
                                  </ul>
                              </nav>
                            </header>
                            <article>
                                 <hgroup>
                                      <h1>My Awesome Article</h1>
                                      <h2>Sub Title</h2>
                                 </hgroup>
                                 <p> Lorem ipsum... </p>
                            </article>
                            <aside>
                               <h1>Blog roll</h1>
                               <p>Content something or other</p>
                               <ul>
                                  <li><a href=’#’>Item 1</a></li>
                                  <li><a href=’#’>Item 2</a></li>
                              </ul>
                             </aside>
                           </body>
                          </html>




Wednesday, May 25, 2011
CREATES AN OUTL INE OF:

                          http://gsnedders.html5.org/
                          outliner/

                          1. My Website
                           1. Main Menu
                           2. My Awesome Article
                           3. Blog Roll



Wednesday, May 25, 2011
NITTY GRITTY
                          DETAILS...
                          Can I use a semantic chop now?




Wednesday, May 25, 2011
YES, IF YOU INCLUDE
                          A SHIV FOR IE < 9
                          •   html5shiv
                          •   (Or just use modernizr.js, which
                              also includes it)
                          •   Fine print: Javascript required




Wednesday, May 25, 2011
SO NO MORE <DIV>’S
                          AND <SPAN>’S?
                          •   Not quite - <divs> and <spans>
                              should still be used for styling and
                              for organizing data with microdata.
                          •   Remember: <article>, <section> et al
                              create new sectioning roots




Wednesday, May 25, 2011
PART 2:
                          ADDITIONAL
                          MEANING


Wednesday, May 25, 2011
SPEAKING OF
                          MICRODATA...
                          A way mark up *your existing html* to give it
                          machine readable meaning.




Wednesday, May 25, 2011
WHY?
                          Again - search engines. We
                          learned from the bad keyword-
                          stuffing days that pure meta-data
                          doesn’t work.




Wednesday, May 25, 2011
MICRO DATA EXAMPLE:
                          <div itemscope>
                           <p>My name is <span
                          itemprop="name">Neil</span>.</p>
                           <p>My band is called <span
                          itemprop="band">Four Parts Water</span>.</
                          p>
                           <p>I am <span
                          itemprop="nationality">British</span>.</p>
                          </div>



                          Create items with itemscope, add
                          properties with itemprop.

Wednesday, May 25, 2011
MORE
                          ATTRIBUTES
                          •   Itemtype - Defines the vocabulary to be
                              used by the microdata format.
                          •   Itemid - The unique identifier of the
                              item, if defined by the microdata
                              vocabulary.
                          •   Itemref - Allows a microdata element to
                              reference another element on the page to
                              define it by either HTML id or by itemid.




                                                                       Reference
Wednesday, May 25, 2011
WHERE IS IT
                          USED?
                          •   Google Rich snippets
                          •   http://www.google.com/
                              support/webmasters/bin/
                              answer.py?answer=99170




Wednesday, May 25, 2011
OPENGRAPH:
                          MAKING FACEBOOK
                          HAPPY
                          Facebook scans your page and pulls
                          information whenever someone likes or
                          shares a page of your site




Wednesday, May 25, 2011
IT’LL JUST PULL RANDOM
                          CR*P IF YOU DON’T ADD
                          OPENGRAPH TAGS




Wednesday, May 25, 2011
ADD META PR OPERTIES
                  TO YOUR <HEAD>

                          <head>
                               <title>The Rock (1996)</title>
                               <meta property="og:title" content="The Rock" />
                               <meta property="og:type" content="movie" />
                               <meta property="og:url" content="http://
                               www.imdb.com/title/tt0117500/" />
                               <meta property="og:image" content="http://
                               ia.media-imdb.com/images/rock.jpg" />
                               ...




                                                                     http://ogp.me/

Wednesday, May 25, 2011
FINALLY RDFA




Wednesday, May 25, 2011
FINALLY RDFA
                          ... Which is too complicated to cover in
                          a few minutes ...


                          But with it’s big brother RDF opens
                          you up to the full world of Web 3.0 &
                          the Semantic Web.




Wednesday, May 25, 2011
THE L INKED DATA GRAPH
           T he Semantic Web

Wednesday, May 25, 2011
THANKS!
                          QUESTIONS?


                          Pascal Rettig
                          cykod.com
                          Twitter @cykod



Wednesday, May 25, 2011
Wednesday, May 25, 2011

More Related Content

What's hot

Collage Cheatsheet
Collage CheatsheetCollage Cheatsheet
Collage Cheatsheetsaravalkova
 
Web Standards: Fueling Innovation [Web Design World - Seattle 2009]
Web Standards: Fueling Innovation [Web Design World - Seattle 2009]Web Standards: Fueling Innovation [Web Design World - Seattle 2009]
Web Standards: Fueling Innovation [Web Design World - Seattle 2009]Aaron Gustafson
 
A Practical Guide to HTML5
A Practical Guide to HTML5A Practical Guide to HTML5
A Practical Guide to HTML5wiltopedia
 
An Introduction To HTML5
An Introduction To HTML5An Introduction To HTML5
An Introduction To HTML5Robert Nyman
 

What's hot (7)

Collage Cheatsheet
Collage CheatsheetCollage Cheatsheet
Collage Cheatsheet
 
Using class suffixes
Using class suffixesUsing class suffixes
Using class suffixes
 
Web Standards: Fueling Innovation [Web Design World - Seattle 2009]
Web Standards: Fueling Innovation [Web Design World - Seattle 2009]Web Standards: Fueling Innovation [Web Design World - Seattle 2009]
Web Standards: Fueling Innovation [Web Design World - Seattle 2009]
 
A Practical Guide to HTML5
A Practical Guide to HTML5A Practical Guide to HTML5
A Practical Guide to HTML5
 
A Practical Guide to HTML5
A Practical Guide to HTML5A Practical Guide to HTML5
A Practical Guide to HTML5
 
An Introduction To HTML5
An Introduction To HTML5An Introduction To HTML5
An Introduction To HTML5
 
Html 5
Html 5Html 5
Html 5
 

Viewers also liked

Web Typography for Front End Developers
Web Typography for Front End DevelopersWeb Typography for Front End Developers
Web Typography for Front End DevelopersPascal Rettig
 
Javascript Everywhere
Javascript EverywhereJavascript Everywhere
Javascript EverywherePascal Rettig
 
The State of Front End Web Development 2011
The State of Front End Web Development 2011The State of Front End Web Development 2011
The State of Front End Web Development 2011Pascal Rettig
 

Viewers also liked (6)

Javascript FTW
Javascript FTWJavascript FTW
Javascript FTW
 
Web Typography for Front End Developers
Web Typography for Front End DevelopersWeb Typography for Front End Developers
Web Typography for Front End Developers
 
Javascript Everywhere
Javascript EverywhereJavascript Everywhere
Javascript Everywhere
 
Web Optimisation
Web OptimisationWeb Optimisation
Web Optimisation
 
Mobile HTML5
Mobile HTML5Mobile HTML5
Mobile HTML5
 
The State of Front End Web Development 2011
The State of Front End Web Development 2011The State of Front End Web Development 2011
The State of Front End Web Development 2011
 

Similar to Semantic chop

SW Drupal Summit: HTML5+Drupal
SW Drupal Summit: HTML5+DrupalSW Drupal Summit: HTML5+Drupal
SW Drupal Summit: HTML5+DrupalJen Simmons
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5Terry Ryan
 
Semantic HTML5
Semantic HTML5Semantic HTML5
Semantic HTML5Terry Ryan
 
HTML5 & Front-end overview
HTML5 & Front-end overviewHTML5 & Front-end overview
HTML5 & Front-end overviewAshish Mukherjee
 
Html5 Brown Bag
Html5 Brown BagHtml5 Brown Bag
Html5 Brown Bagstuplum
 
Html5 quick-learning-quide
Html5 quick-learning-quideHtml5 quick-learning-quide
Html5 quick-learning-quideAshok Suragala
 
Html5 quick-learning-quide
Html5 quick-learning-quideHtml5 quick-learning-quide
Html5 quick-learning-quideJerry Wijaya
 
Html5 quick-learning-quide
Html5 quick-learning-quideHtml5 quick-learning-quide
Html5 quick-learning-quidePL dream
 
HTML5 Essential Training
HTML5 Essential TrainingHTML5 Essential Training
HTML5 Essential TrainingKaloyan Kosev
 
LIS3353 SP12 Week 4
LIS3353 SP12 Week 4LIS3353 SP12 Week 4
LIS3353 SP12 Week 4Amanda Case
 
HTML5+CSS3 (入門編)
HTML5+CSS3 (入門編)HTML5+CSS3 (入門編)
HTML5+CSS3 (入門編)博史 高木
 
5 ways to embrace HTML5 today
5 ways to embrace HTML5 today5 ways to embrace HTML5 today
5 ways to embrace HTML5 todayDaniel Ryan
 
HTML Coding #01 : Don't Fear the Code
HTML Coding #01 : Don't Fear the CodeHTML Coding #01 : Don't Fear the Code
HTML Coding #01 : Don't Fear the CodeMichael Sturgeon
 
HTML 5 Fundamental
HTML 5 FundamentalHTML 5 Fundamental
HTML 5 FundamentalLanh Le
 
Introduction to HTML.pptx
Introduction to HTML.pptxIntroduction to HTML.pptx
Introduction to HTML.pptxmalrad1
 

Similar to Semantic chop (20)

SW Drupal Summit: HTML5+Drupal
SW Drupal Summit: HTML5+DrupalSW Drupal Summit: HTML5+Drupal
SW Drupal Summit: HTML5+Drupal
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Web 101 intro to html
Web 101  intro to htmlWeb 101  intro to html
Web 101 intro to html
 
Semantic HTML5
Semantic HTML5Semantic HTML5
Semantic HTML5
 
Html5 semantics
Html5 semanticsHtml5 semantics
Html5 semantics
 
HTML5 & Front-end overview
HTML5 & Front-end overviewHTML5 & Front-end overview
HTML5 & Front-end overview
 
Html5 Brown Bag
Html5 Brown BagHtml5 Brown Bag
Html5 Brown Bag
 
Html5 quick learning guide
Html5 quick learning guideHtml5 quick learning guide
Html5 quick learning guide
 
Html5 quick-learning-quide
Html5 quick-learning-quideHtml5 quick-learning-quide
Html5 quick-learning-quide
 
Html5 quick-learning-quide
Html5 quick-learning-quideHtml5 quick-learning-quide
Html5 quick-learning-quide
 
Html5 quick-learning-quide
Html5 quick-learning-quideHtml5 quick-learning-quide
Html5 quick-learning-quide
 
HTML5 Essential Training
HTML5 Essential TrainingHTML5 Essential Training
HTML5 Essential Training
 
LIS3353 SP12 Week 4
LIS3353 SP12 Week 4LIS3353 SP12 Week 4
LIS3353 SP12 Week 4
 
HTML5+CSS3 (入門編)
HTML5+CSS3 (入門編)HTML5+CSS3 (入門編)
HTML5+CSS3 (入門編)
 
5 ways to embrace HTML5 today
5 ways to embrace HTML5 today5 ways to embrace HTML5 today
5 ways to embrace HTML5 today
 
HTML Coding #01 : Don't Fear the Code
HTML Coding #01 : Don't Fear the CodeHTML Coding #01 : Don't Fear the Code
HTML Coding #01 : Don't Fear the Code
 
Html5
Html5Html5
Html5
 
HTML 5 Fundamental
HTML 5 FundamentalHTML 5 Fundamental
HTML 5 Fundamental
 
Introduction to HTML.pptx
Introduction to HTML.pptxIntroduction to HTML.pptx
Introduction to HTML.pptx
 
Html5 semantics
Html5 semanticsHtml5 semantics
Html5 semantics
 

Recently uploaded

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Recently uploaded (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Semantic chop

  • 1. SEMANTIC HTML5 101 or “Bye bye divitis” Pascal Rettig On Twitter @cykod Wednesday, May 25, 2011
  • 2. Born in 1989 by Tim Berner’s Lee HTML IS IN TO ITee EA ’S RLY 20’S Born in 1989 by Tim Berner’s L Wednesday, May 25, 2011
  • 3. LI FE CRniSgI”S QUAR3TERing to find “Mea n I FACINlGr A ML5 & Web .0 is try fo HT The big goa Wednesday, May 25, 2011
  • 4. WHAT IS A “SEMANTIC CHOP”? A way to give structure and meaning to the HTML that you generate. Wednesday, May 25, 2011
  • 5. W HO IS TH IS FOR? • Primarily clients other than your usual Web Browsers. • The Google, Other Search Engines, Data Aggregators, Screen Readers, “Non- traditional” browsers Wednesday, May 25, 2011
  • 6. THE GOALS • HTML tags used in Meaningful ways • All styling information left to CSS • Validating markup • All dynamic interactions added “unobtrusively” (usually via jQuery) Wednesday, May 25, 2011
  • 7. HOW DOES HTML5 ACHIEVE THIS? Wednesday, May 25, 2011
  • 8. #1 A BOATLOAD OF MEANINGFUL TAGS. <article> <aside> <audio> <canvas> <command> <datalist> <details> <embed> <figcaption> <figure> <footer> <header> <hgroup> <keygen> <mark> <meter> <nav> <output> <progress> <rp> <rt> <ruby> <section> <source> <summary> <time> <video> <wbr> http://www.w3schools.com/html5/ tag_wbr.asp Wednesday, May 25, 2011
  • 9. #2SECTIONING TAGS <article> <aside> <nav> <section> (Also <details> <figure> act as the same, but don’t add to the parent section) Wednesday, May 25, 2011
  • 10. EACH CREATES A NEW “SECTION” OF YOUR PAGE Each of these represents a separate line in the outline of your document. Wednesday, May 25, 2011
  • 11. #3ORGANIZATIONAL ELEMENTS <header> <footer> <hgroup> Wednesday, May 25, 2011
  • 12. CAN BE USED TO GROUP CONTENT TOGETHER (But does not create a separate sectioning root) Wednesday, May 25, 2011
  • 13. #4SELF-CONTAINED “SYNDICATABLE” CONTENT All <article>’s should be self-contained elements They can contain their own <h1>’s <header>’s <footer>’s etc Wednesday, May 25, 2011
  • 14. #5ADDED MEANING TO HTML5 TAGS <em>Emphasized text</em> <strong>Strong text</strong> <dfn>Definition term</dfn> <code>Computer code text</code> <samp>Sample computer code text</samp> <kbd>Keyboard text</kbd> <var>Variable</var> <cite>Citation</cite> Wednesday, May 25, 2011
  • 15. E XAMPLE: <!DOCTYPE html> <html> <head> ... Head Stuff .. </head> <body> <header> <h1>My Website</h1> <nav id=‘main-menu’> <h1>Main Menu</h1> <ul> <li><a href=’#’>Item 1</a></li> <li><a href=’#’>Item 2</a></li> </ul> </nav> </header> <article> <hgroup> <h1>My Awesome Article</h1> <h2>Sub Title</h2> </hgroup> <p> Lorem ipsum... </p> </article> <aside> <h1>Blog roll</h1> <p>Content something or other</p> <ul> <li><a href=’#’>Item 1</a></li> <li><a href=’#’>Item 2</a></li> </ul> </aside> </body> </html> Wednesday, May 25, 2011
  • 16. CREATES AN OUTL INE OF: http://gsnedders.html5.org/ outliner/ 1. My Website 1. Main Menu 2. My Awesome Article 3. Blog Roll Wednesday, May 25, 2011
  • 17. NITTY GRITTY DETAILS... Can I use a semantic chop now? Wednesday, May 25, 2011
  • 18. YES, IF YOU INCLUDE A SHIV FOR IE < 9 • html5shiv • (Or just use modernizr.js, which also includes it) • Fine print: Javascript required Wednesday, May 25, 2011
  • 19. SO NO MORE <DIV>’S AND <SPAN>’S? • Not quite - <divs> and <spans> should still be used for styling and for organizing data with microdata. • Remember: <article>, <section> et al create new sectioning roots Wednesday, May 25, 2011
  • 20. PART 2: ADDITIONAL MEANING Wednesday, May 25, 2011
  • 21. SPEAKING OF MICRODATA... A way mark up *your existing html* to give it machine readable meaning. Wednesday, May 25, 2011
  • 22. WHY? Again - search engines. We learned from the bad keyword- stuffing days that pure meta-data doesn’t work. Wednesday, May 25, 2011
  • 23. MICRO DATA EXAMPLE: <div itemscope> <p>My name is <span itemprop="name">Neil</span>.</p> <p>My band is called <span itemprop="band">Four Parts Water</span>.</ p> <p>I am <span itemprop="nationality">British</span>.</p> </div> Create items with itemscope, add properties with itemprop. Wednesday, May 25, 2011
  • 24. MORE ATTRIBUTES • Itemtype - Defines the vocabulary to be used by the microdata format. • Itemid - The unique identifier of the item, if defined by the microdata vocabulary. • Itemref - Allows a microdata element to reference another element on the page to define it by either HTML id or by itemid. Reference Wednesday, May 25, 2011
  • 25. WHERE IS IT USED? • Google Rich snippets • http://www.google.com/ support/webmasters/bin/ answer.py?answer=99170 Wednesday, May 25, 2011
  • 26. OPENGRAPH: MAKING FACEBOOK HAPPY Facebook scans your page and pulls information whenever someone likes or shares a page of your site Wednesday, May 25, 2011
  • 27. IT’LL JUST PULL RANDOM CR*P IF YOU DON’T ADD OPENGRAPH TAGS Wednesday, May 25, 2011
  • 28. ADD META PR OPERTIES TO YOUR <HEAD> <head> <title>The Rock (1996)</title> <meta property="og:title" content="The Rock" /> <meta property="og:type" content="movie" /> <meta property="og:url" content="http:// www.imdb.com/title/tt0117500/" /> <meta property="og:image" content="http:// ia.media-imdb.com/images/rock.jpg" /> ... http://ogp.me/ Wednesday, May 25, 2011
  • 30. FINALLY RDFA ... Which is too complicated to cover in a few minutes ... But with it’s big brother RDF opens you up to the full world of Web 3.0 & the Semantic Web. Wednesday, May 25, 2011
  • 31. THE L INKED DATA GRAPH T he Semantic Web Wednesday, May 25, 2011
  • 32. THANKS! QUESTIONS? Pascal Rettig cykod.com Twitter @cykod Wednesday, May 25, 2011