rokni's weblog

Rokni.com's weblog enables Ali M. Rokni to access and share usefull information of the World Wide Web new technologies with friends and visitors of the site.

Tuesday, July 27, 2004

Writing Efficient CSS

The Benefits of Efficiency

One of the touted benefits of CSS is that it reduces total page weight, and thus download time, both at first page load, and even more on subsequent loads due to style sheet caching. This is true, but often a sizable fraction of the first load savings is lost because of highly redundant CSS code.

Commonly used shorthand properties include:
  • font (controls "font-size", "font-weight", "line-height", etc.)
  • background (controls element backgrounds, placement, repeating, etc.)
  • list-style (sets the properties of the list item "bullet")
  • margin (defines the width of margins on the sides of a box)
  • border (defines properties for the borders on a box - there are several shorthand properties involving borders)
  • padding (defines the width of padding within the sides of a box)
Writing Efficient CSS

0 Comments:

Post a Comment

<< Home

Previous Posts

1999-2008 © rokni.com