Layer Styles for Speed

With cascading and inheritance built-in, style sheets can be layered from separate global and local styles and gracefully merge together. Multiple style sheets can be overlaid for multiple purposes, each cascading happily over the other according to the cascading rules of CSS.

Use Media Types

You can separate styles for different output media into separate style sheets. For example:

 <link rel="stylesheet" type="text/css" href="/screen.css" media="screen">  <link rel="stylesheet" type="text/css" href="/print.css" media="print"> 

Presumably you'd use relative units for the screen style sheet and absolute units for the print style sheet. This separation means faster, more efficient pages. It's faster than one all-purpose style sheet because only the style sheet that matches the output media will load, which saves bandwidth.

 



Speed Up Your Site[c] Web Site Optimization
Speed Up Your Site[c] Web Site Optimization
ISBN: 596515081
EAN: N/A
Year: 2005
Pages: 135

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net