Site Map
menu 1
menu 2
menu 3
menu 4
menu 5
menu 6
 
Onsite Training
Since 2003, iCellini Computer Training has been San Diego's number one choice for onsite computer training.

The Transition to CSS

(page 2 of 3)

If we had to rely solely on HTML markup, here's what the code might look like:

<font size="5" face="Arial, Helvetica, sans-serif" color="#3130E3"> <b>The Transition to CSS </b> </font> <hr color="#3130E3" />

There are a few problems with the above code.

First of all, to format all your titles throughout your web site, you would have to add this code to each and every title. If your web site had 50 pages with 50 titles, you would have to markup 50 titles. This is not only time consuming, but what if you later decide to modify your titles? Again, you would have to modify 50 titles. Sheesh!

With CSS, all you have to do is create one rule in an external stylesheet and link it to your documents. Each time you use the h1 selector, your title will be automatically styled the way you want. If you need to modify the 50 titles in your web site, all you have to do is modify that one rule in your external stylesheet and the changes will be automatically updated throughout your web site.

Another problem with the above HTML markup is its use of deprecated HTML tags. The font and bold tags and all presentation attributes of the <hr> element are deprecated (flagged to be removed in future specifications). The W3C deprecated all HTML presentational elements in the last version of HTML (version 4.01). If you wish to follow a Strict DOCTYPE such as HTML 4.01 Strict or XHTML 1.0 Strict, you cannot use deprecated tags. You could use a transitional DOCTYPE which allows the use of deprecated tags. Browsers continue to support deprecated tags for backward compatibility, but I would encourage you to keep up with standards and write valid code.

Another benefit of cascading style sheets is smaller file sizes resulting in faster downloads. Using stylesheets dramatically cuts down on HTML markup reducing the file size of your web pages. Also, styles only need to be downloaded once, on the first page the visitor accesses. The stylesheet is cached on the user's hard drive and does not need to be downloaded again for all other pages that use that stylesheet.

CSS is not a new technology. The W3C release the CSS 1 recommendation December 17, 1996. The CSS 2 recommendation was formalized on May 12, 1998. CSS 3 is still in development. The last version of HTML, HTML 4.01, was officially released in December 1999. Shortly afterward, W3C released XHTML in January 2000. So why has it taken web designers so long to transition from HTML presentational elements to CSS?

The short answer is this: web browser technology has lagged way behind CSS technology. Browser support is the biggest issue relating to CSS. Browser support for CSS has always been incomplete. In older browsers such as Netscape 4 and IE4, support for CSS is almost nonexistent. Even today, CSS support is incomplete and inconsistent across browsers. Internet Explorer, the most popular browser in use today, has the weakest support for CSS.

page 1 | 2 | 3 | next >>