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)
0 Comments:
Post a Comment
<< Home