User Tools

Site Tools


eg-146:lecture13

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
eg-146:lecture13 [2012/03/08 18:42] – [Defining a section] eechriseg-146:lecture13 [2012/03/08 23:20] – [Improving Accessibility with ARIA] eechris
Line 226: Line 226:
 ===== Defining a section =====  ===== Defining a section ===== 
  
-> The section element represents a generic section of a document or application. A section, in this  context, is a thematic grouping of content, typically with a heading.+> The ''section'' element represents a generic section of a document or application. A section, in  
 +this  context, is a thematic grouping of content, typically with a heading.
 > >
 > Examples of sections would be chapters, the various tabbed pages in a tabbed dialog box, or the   > Examples of sections would be chapters, the various tabbed pages in a tabbed dialog box, or the  
Line 232: Line 233:
 > introduction, news items, and contact information. > introduction, news items, and contact information.
  
 +[[http://dev.w3.org/html5/spec/Overview.html#the-section-element|W3C, //Section 4.4.2 The Section Element//, HTML5 Spec.]]
 +
 +[[http://www.bruceontheloose.com/htmlcss/examples/chapter-03/defining-a-section.html|Example]]
 +
 +===== When to use? =====
 +
 +Is your content an independent piece of content or a widget that would be appropriate for syndication? 
 +  * **Yes** -- Use  ''article''
 +  * **No** -- use ''section'' (but see [[#Generic containers]] later)
 ===== Specifying an aside =====  ===== Specifying an aside ===== 
 +
 +For tangentially related sections of content that could stand on its own is marked up using the ''aside'' element.
 +
 +  * [[http://www.bruceontheloose.com/htmlcss/examples/chapter-03/specifying-an-aside.html|Example]]
 +
 +----
 +
 +<note>
 +''aside''s are often rendered by CSS by removing them from the amin body and moving them to a side column.
 +</note>
 ===== Creating a footer =====  ===== Creating a footer ===== 
 +
 +<code html>
 +<footer>
 +  <p><small>&copy; Copyright 2011</small></p>
 +</footer>
 +</code>
 ===== Generic containers ===== ===== Generic containers =====
 +
 +Sometimes you need a container that has no particular semantic meaning but which is useful for the purpose of styling and JavaScript. The ''div'' element can be used for this purpose.
 +
 +Examples:
 +  * [[http://www.bruceontheloose.com/htmlcss/examples/chapter-03/no-divs.html|Use of a div to demarcate the content]]
 +  * [[http://www.bruceontheloose.com/htmlcss/examples/chapter-03/divs-with-ids.html|divs with ids]]
 +
 +----
 +
 +<note>
 +Before HTML5 ''<div id="container-name">...</div>'' was the only way to create the sectioning features that we have just described. In fact it was a survey of the common ways that divs where used by web designers that led the designers of HTML5 to the collection of sectioning elements that we now have. For example ''<div id="header">'', ''<div id="footer">'', ''<div id="nav">'', etc can still be observed in many "legacy" web sites that are not marked up in HTMl5.
 +</note> 
 ===== Improving Accessibility with ARIA ===== ===== Improving Accessibility with ARIA =====
 +
 +[[http://www.w3.org/WAI/intro/aria|WAI-ARIA]] (Web Accessibility Initiative's Accessible Rich Internet Applications), or ARIA for short, adds additional attributes to elements that can help further improve the accessibility of web pages.
 +
 +Examples:
 +
 +  * ''role="application"'', ''role="banner"'', ''role="complementary"''
 +  * ''role="contentinfo"'', ''role="form"'', ''role="main"'', 
 +  * ''role="navigation"'', ''role="search"''
 +
 +[[http://www.bruceontheloose.com/htmlcss/examples/chapter-03/improving-accessibility-aria.html|Example]] 
 ===== Naming elements ===== ===== Naming elements =====
 ===== Commenting your code ===== ===== Commenting your code =====
eg-146/lecture13.txt · Last modified: 2012/03/12 09:18 by eechris