Docsity

HTML5 Semantics: Understanding New Tags and Their Role in Document Structure, Slides of Computer Programming

Partial preview of the text

Download HTML5 Semantics: Understanding New Tags and Their Role in Document Structure and more Slides Computer Programming in PDF only on Docsity!

HTML5 Structure

Introduction

 Introduce the purpose of the new HTML semantic tags  Introduce the HTML5 outlining mode  Semantic metadata for search engines

HTML5 – The Paradigm Shift

 Pre HTML  Used the **** and **** tags to mark / identify blocks of content  **** tags to define the document hierarchy  Now  We have semantic tags that help search engines know what your Web site content “means”  Google Recipes

My Thoughts

 We expect the Web to perform a rich set of tasks  All things to all people  And there are many folks defining the standards  This leads to many standards that take time to shake out  So the semantic web is very much in the development phase  HTML 5 is a living language right now

The and

Tags (Introduction)

 Set the class attribute to apply a CSS style to a document section (more later)  Set the id attribute to uniquely identify the element (more later)

 Use these tags for formatting and as template locations for content insertion  In some cases the semantic tags deprecate **** and ****

The Tag (Example)

 Apply formatting to “text”. The formatting comes from the class “bright”

text

Syndication and Aggregation

 We often pull content from other Web sites but don’t know how that content is laid out  That content is buried within our comment  The semantic elements help to solve this problem

Semantic Elements (List -1)

 **** - Self contained content  newspaper article, blog post  **** - Tangential content  Related articles, related posts, differing opinions  **** and **** - represents a figure  Use to associate an image (having little meaning), with its caption

Semantic Elements and

Document Structure

 As we begin to program (with JavaScript and other languages) you will see how a document has a well-defined structure and how it’s used to manipulate the document  The semantic elements have an effect on the document’s outline

The Document Outline

(Introduction)

 It’s just an outline as you would use in Word or anywhere else

 It’s not well-adopted so we will not spend too much time on the topic

The Document Outline

(Implementation)

 As your book mentions, browsers don’t render the document outline at this point

 It’s really the DOM structure which we will get to later

The Document Outline

(Best Practice)

 Wrap in an  Wrap in a

HTML5 Microdata

 **** - set the datetime attribute to “YYYY-MM-DD HH:MM+00:  Time a blog posting was made  The visible content can be anything  **** - replaces div for calculation output or other output value  **** - Text referencing something and thought to be important

Other Semantic Standards

 The “standards” are evolving and there are many of them  The semantic goals differ  Accessibility  Content description  Data mining  ARIA, RDFa, Microformats, Microdata