JavaScript EditorDebugger script     Dhtml css 



Team LiB
Previous Section Next Section

Sunday Afternoon: Working with Styles

Overview

Cascading Style Sheets (CSS) were introduced as a standard in 1996 to allow the creation of richly designed Web pages that are also efficient and accessible. One of the primary deficiencies of HTML, by itself, is that the ability to create more richly designed Web pages and sites was incorporated in an ad hoc fashion, through proprietary extensions to HTML that were developed by browser vendors (primarily Netscape and Microsoft). Many of these extensions were incorporated into HTML 3.2 and HTML 4, in order to try to standardize their use and implementation, but were also deprecated at the same time. Deprecation means that while use of these elements and attributes is legal, their use is discouraged in favor of using styles to achieve similar or superior results. Many Web authors, however, choose to continue to use deprecated elements and attributes because designing Web pages using styles presents compatibility issues with earlier browsers that have flawed CSS implementations (Internet Explorer 3 and Netscape 4, primarily).

Currently, two versions of the CSS standard have been introduced, CSS1 (Cascading Style Sheets, level one) and CSS2 (Cascading Style Sheets, level two). A third version, CSS3 (Cascading Style Sheets, level 3) is currently in the draft stage. Current browsers support almost all of CSS1 and significant parts of CSS2. As with HTML, previous versions are primarily preserved in later versions of CSS, like the layers of an onion.

More recent browsers, however, are much more standards-compliant, with support for at least CSS1, and much of CSS2, now common. Fewer users are running earlier browsers with flawed CSS implementations. Reliable techniques and methods have also been discovered or developed that allow for the creation of both backward and forward-compatible Web page designs using styles. Now, there really is no reason to not use styles.

Because of the excellent support for Web standards that are incorporated in the latest browsers, William Arnold has decided to upgrade the Egg Facts and Figures page he created for the Good Egg Company. He wants his page to be compatible with the strict definition of HTML 4.01, which means it can't contain any deprecated elements or attributes and must depend upon using Cascading Style Sheets (CSS) to control the page's presentational appearance. He has already removed deprecated elements and attributes from the document and is now ready to upgrade it.

Note 

To preview this session's examples, you should use a current browser that provides excellent support for the HTML 4.01 and CSS standards. I recommend that you use any of the following browsers (or later versions):


Team LiB
Previous Section Next Section


JavaScript EditorDebugger script     Dhtml css