Home » Website Optimization Secrets » CSS Optimization Chapter 7

CSS Optimization Chapter 7

Cascading Style Sheet (CSS) optimization transforms your HTML by abstracting inline style and behavior into minimal style sheets. Whereas CSS makes a site easier to maintain, CSS optimization makes it load faster and makes it more search-engine friendly.

In this chapter, you’ll learn how to shrink your style sheets and HTML at the same time. CSS-specific techniques include (1) grouping declarations and selectors, (2) merging common styles into shared classes, (3) inheritance, (4) abbreviating with shorthand properties, and (5) abbreviating class and ID names. HTML-oriented techniques include replacing JavaScript behavior with CSS, designing markup for descendant selectors, and CSS layout. By combining these techniques, you can reduce HTML and CSS file sizes by up to 50%. When you plan your site in this way you are giving it what we call CSS architecture.

To maximize display speed you can employ the following ten techniques: