13.07.2015 Views

Beginning CSS: Cascading Style Sheets for Web Design, 2nd ...

Beginning CSS: Cascading Style Sheets for Web Design, 2nd ...

Beginning CSS: Cascading Style Sheets for Web Design, 2nd ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 2: The EssentialsFigure 2-6How It WorksIn Figure 2-6 you see the hierarchy of a style sheet, drilling down from the whole style sheet to the valueof a property. In Example 2-1, you included a single <strong>CSS</strong> rule with a selector that provides properties <strong>for</strong>all six HTML heading elements, , , , , , and . The selector contains threedeclarations that provide the browser with in<strong>for</strong>mation about how to style the a<strong>for</strong>ementioned headingelements. The browser is told to give each heading text colored maroon in the sans-serif font face, and abottom border that’s gray, solid, and one pixel thick.<strong>CSS</strong> CommentsAs is the case with HTML, comment text can be added to style sheets as well. In a multipage template,this helps you remember which <strong>CSS</strong> rule applies to what or why it was added in the first place. <strong>CSS</strong> supportsmultiline comments that begin with a <strong>for</strong>ward slash and an asterisk (/*) and terminate with anasterisk and a <strong>for</strong>ward slash (*/). This is illustrated in Figure 2-7.Figure 2-729

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!