Home arrow Web Standards arrow Page 2 - Get Down With Markup
WEB STANDARDS

Get Down With Markup


Lists may seem to be mundane items, but many pages on the Web include at least one. The way you choose to mark up these lists can make a big difference. This article explores several the advantages and disadvantages of several common markup methods. It is taken from chapter one of Dan Cederholm's book Web Standards Solutions: The Markup and Style Handbook (Apress, 2004; ISBN: 1590593812).

Author Info:
By: Apress Publishing
Rating: 3 stars3 stars3 stars3 stars3 stars / 11
February 15, 2005
TABLE OF CONTENTS:
  1. · Get Down With Markup
  2. · Quiz time
  3. · Method B: The bullet that bites
  4. · Method C: Getting closer
  5. · Method D: Wrapperís delight
  6. · Extra credit
  7. · Getting fancier with custom bullets
  8. · Lists that navigate
  9. · Mini-tab shapes

print this article
SEARCH DEVARTICLES

Get Down With Markup - Quiz time
(Page 2 of 9 )

Which of the following would be best for marking up a grocery list?

Method A: The <br /> breakdown

  Apples<br /> 
  Spaghetti<br /> 
  Green Beans<br /> 
  Milk<br />
 

Method A is certainly one thatís been used for years, heavily, on perhaps millions of web pages. In fact, Iím sure weíre all guilty of using this approach at one time or another, right? Weíd like each item in the list to be on its own line, and by inserting a break tag (using the valid XHTML, self-closing version here, <br />) a line break will be added after each item. Thatís about all it does, and it seems to work.

However, what if we wanted to style the grocery list differently from other elements on the page? For instance, what if we would like this list to have red links instead of the default blue, or a different font size from the rest of the text on the page? We really canít. Weíre stuck with whatever default font styles weíve set for the entire document (if there are any at all), and since thereís no surrounding element for the list, we canít assign it any unique CSS rules.

Itís a wrap

Letís also say that we added a particularly long grocery item to the list: ďFive Foot Loaf of Anthonyís Italian BreadĒ. Depending on where this list is placed in the layout of the page, long items may run the risk of wrapping to the next line if there isnít enough horizontal space, or if the userís browser window width is narrow.

It would be also be nice to take into account the possibility of low-vision users increasing their default text size to gain readability. Line items that we thought fit just great in a narrow column, as in Figure 1-1, now break in unpredictable places, as in Figure 1-2, throwing off the design when the text size is increased by the user.

               Figure 1-1.  An example with default text size

 

Figure 1-2.  The same example with increased text size

Hmm. Now, I know Iím supposed to buy bread, but the two lines that precede it in Figure 1-2 are a bit confusing.

A similar wrapping dilemma rears its ugly head when long lines are viewed on the small screen of a device such as a phone or Personal Digital Assistant (PDA). The ultimate technophile may stroll into the supermarket with Palm Pilot in hand, rather than the traditional sheet of paper for their shopping list, yet they eventually wander aimlessly, looking up and down the aisles for ďAnthonyís Italian.Ē

Iím essentially proving a point hereóthat using Method A doesnít take into account the fluidity that web pages can have depending on variables that are outside the designerís control.

This chapter is from Web Standards Solutions: The Markup and Style Handbook by Dan Cederhold (Apress, 2004, ISBN:  1590593812). Check it out at your favorite bookstore today. Buy this book now.


blog comments powered by Disqus
WEB STANDARDS ARTICLES

- Mozilla Popcorn Maker 1.0 Makes Videos More...
- Completing a Configuration for Chrome and a ...
- Getting Connected with Firefox and Chrome
- Configuring Servers and Databases with Chrome
- Configuring Firefox for Chrome and a Server
- Designing the Elements of a Web Page
- Matching div heights with CSS and JavaScript
- Forms
- Get Down With Markup
- If I Said You Had a Beautiful Body...
- Web Standards in Dreamweaver Part 3
- Web Standards in Dreamweaver, Part 2
- Web Forms
- Making Lists Using XHTML
- Web Standards in Dreamweaver, Part 1

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials