Summary

 < Day Day Up > 



Now that I've picked each possible method apart, let's quickly review what I've covered about each:

Method A:

  • Leaves out the possibility for styling the list uniquely

  • Could create confusion when longer lines wrap in a narrow column or small-screened device

  • Lacks semantic meaning

Method B:

  • Adding a bullet helps for signifying a new item, but some browsers may choose not to show it, without its parent <ul> element.

  • No containing <ul> element or closing </li> elements means difficult to style.

  • Invalid.

Method C:

  • Closing the </li> element eliminates the need for <br /> tags.

  • Omitting the <ul> element makes it difficult to style this particular list differently.

  • Invalid.

Method D:

  • Valid!

  • Provides semantic meaning and structure.

  • Bullets will render to the left of each item on most browsers.

  • Wrapping lines will indent on most browsers.

  • It can be easily styled uniquely with CSS.

As you can see, you can learn a lot from a seemingly innocent little question. Even if you're already using Method D exclusively on all of your pages, it's nice to know why you do things the way you do. We'll continue to explore such "why" questions throughout the book, giving you more ammunition to make the best choice at the right time.



 < Day Day Up > 



Web Standards Solutions. The Markup and Style Handbook
Web Standards Solutions: The Markup and Style Handbook (Pioneering Series)
ISBN: 1590593812
EAN: 2147483647
Year: 2003
Pages: 119
Authors: Dan Cederholm

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net