HTML and CSS Reference
Adding Presentational Styles
IN THIS CHAPTER, you take a deeper look at some of the properties you've already used, learn how to use short-
hand properties and property values, and learn many more properties to make Cool Shoes & Socks really stand out!
Before you begin reading about presentational styles, first set up the page to give it a little more structure:
Project Files Update (ch05-00): If you haven't followed the previous instructions and are comfortable working from
here onward or would like to reference the project files up to this point, you can download them from
1. In styles.css, find the body rule set and add the following declarations:
margin: 0 auto;
2. Save styles.css.
These properties—that center the web page as shown in Figure 5-1—are covered in Chapters 6-9. It's kind of looking
more like a web page now, right?
In CSS3 Foundations , each property definition begins with key information about that property, which consists of:
• The property's initial value
• Whether the value is inherited
• Which elements the property can be applied to
• Whether the property is from the CSS2.1 or CSS3 specification
• Which browsers the property is supported in
A property's initial value is that which is applied to an element prior to your changing it via CSS. For example, many
elements have an initial background color of transparent .
If a property is inherited, it is passed down to the child elements of the element to which it is applied. For example,
when you gave the <body> a font-size of 62.5% in Chapter 4, that font-size was inherited by all the ele-
ments contained within the <body> .