Tuesday, March 26, 2013

Menus & Nav and Validating HTML

Last week we went over Navigation and Navigating HTML 5. The <nav> should only be used for the main user navigation of a web page, not for advertising links down the bottom of the page, or for a secondary navigation relating to a small part of the page.

Also, using a list for menu items can better help organize and maintain proper structure of your page. An example would be:

<nav>
 <ul>
   <li><a href="about.html">About</a></li>
   <li><a href="news.html">News</a></li>
   <li><a href="contact.html">Contact</a></li>
 </ul>
</nav>
  
You can also nest the lists within the<nav> tag so it helps screen readers and helps differentiate the content. By using lists, one can create more functional and organized webpages.

Because technology is always advancing, it's helpful to validate your HTML.  Validation is your early-warning system about introducing bugs into your markup that can manifest in interesting and hard-to-determine ways. By validating, you can check to see if your website is compatible with updating browsers and for accessibility issues as well as a variety of other things. This is turn, allows you to have the best functioning website you could.

 

No comments:

Post a Comment