Summary

 < Day Day Up > 



For this chapter, there may not be a real clear-cut winner here, although there are two methods that I think rise above the others (C and D), each having their own pros and cons. Let's recap the facts regarding each:

Method A:

  • Should work across most browsers.

  • As an empty element, it provides no structure or meaning to the markup.

  • Requires extra markup.

  • With the name attribute being depreciated in XHTML 1.0, forward compatibility should be a concern.

Method B

  • Should work across all browsers.

  • Requires extra markup.

  • Must be conscious of any global <a> element styling that could override outer element styles.

  • With the name attribute being depreciated in XHTML 1.0, forward compatibility can be a concern.

Method C

  • Less markup.

  • Has the option of using an existing ID.

  • Ensures forward compatibility.

  • Requires a reasonably modern browser.

Method D

  • Both forward and backward compatible.

  • Must be conscious of any global <a> element styling that could override outer element styles.

  • Requires extra markup.

It appears that Methods C and D are the better choices, where forward compatibility and less markup are pitched against more markup and full compatibility. My suggestion is to take into account the target audience and make an informed decision based on this.

For instance, if you're building a web-based application or intranet that you know will require a recent browser version, then going with Method C would most likely be best. Less markup is required—but this is not known to work in some version 4.x browsers.

Alternatively, if you're building a site that could be viewed by anyone, anytime, you may opt to go with Method D, which will ensure backward and forward compatibility—with the extra baggage of the anchor tag added.

It's your choice, and hopefully by looking at each, you can make the right decision at the right time out in the real world.



 < 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