CSS in Action Guide you to undestand CSS from simple to advance design

 

Thursday, March 22, 2007

Dynamically Loading Style Sheets

Browser sniffing is a long-established JavaScript practice. Before CSS came to the forefront, Web developers had to cope with a plethora of browsers, each with its own mix of standard HTML and proprietary tags. Many designers found creating multiple versions of their sites to be an onerous, but necessary, task.Which version of the site was served to the visitor depended on JavaScript code to detect the browser version and redirect accordingly.

The Web has grown wildly in intervening years, and the creation and ongoing maintenance of browser-specific site editions is no longer efficient or necessary.With the rise of standardscompliant browsers, more and more designers have switched to using CSS—a switch that JavaScript is ready to help with.Today, browser sniffers are largely used to detect the current browser so that the proper style sheet can be employed. Maintaining a series of style sheets is far more feasible than keeping up with the updates for a number of variations of an entire site.

To be continued....