HTML and CSS Reference
In-Depth Information
Written Communication: Updating a Legacy Page
Revamping a Web site can be an expensive and time-consuming process. It's not surpris-
ing, therefore, that many businesses use Web sites that are based on HTML code that is
more than 10 years old, involving elements and attributes that have long been deprecated.
However, trying to piggyback new content on old code often can result in code that is cum-
bersome and difficult to interpret, making it even more difficult and expensive to update
the site in the future.
When your business decides to update its legacy pages, here are some things you should
consider doing:
Always add a DTD. Whether or not you plan to validate your Web site, always add a DTD
to ensure that the browser renders the page in Standards mode rather than Quirks mode.
If you update your site to HTML5, use the basic <!DOCTYPEƒhtml> DTD.
Use standard syntax. Even though HTML5 supports variations in syntax, your code will
be easier to maintain if you adopt standard syntax rules such as always using lowercase
element and attribute names, providing attribute values for every attribute, and closing
empty elements with a closing slash.
Replace all presentation elements. Older Web sites will be filled with presentational ele-
ments such as the font , center , and u elements. Replace these with CSS styles.
Replace all presentational attributes. Attributes such as width , align , and color should
be replaced with CSS styles.
Use CSS for layout. A common practice with older Web sites is to use tables for page
layout. Replace all tabular layouts with CSS layout styles.
Despite the work and expense involved, upgrading your company's Web site will pay for
itself in the long run. The updated site will be easier to use and maintain, and will be more
easily adaptable to design changes in the future.
With the addition of the XHTML namespace, you have converted Tom's original
HTML document into XHTML format. In the next session, you'll test this document to
determine whether it passes the W3C tests for well-formedness and validity.
Search WWH ::




Custom Search