27.02.2013 Views

Suitcase Fusion 3 User Guide for Mac OS - Extensis

Suitcase Fusion 3 User Guide for Mac OS - Extensis

Suitcase Fusion 3 User Guide for Mac OS - Extensis

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Style<br />

In CSS, the “style” applies to much more than fonts. CSS is used to specify element color, background, size,<br />

position, and many other properties.<br />

Sheets<br />

By defining a style sheets as an independent list, you can better understand how the style—the look of your web<br />

page—is separated from the content of your page, and how this separation can benefit you when you want to<br />

change how your page looks. Instead of changing each element in a page, you can change the definitions in<br />

your style sheet to instantly change your entire page.<br />

Best of all, you can use one style sheet <strong>for</strong> all the pages in your website. This gives you one place where you can<br />

change the entire look of your site. All that power, waiting <strong>for</strong> you to start using it.<br />

References<br />

There are several good books and websites devoted to learning CSS and putting it to work <strong>for</strong> you. You can<br />

learn the basics <strong>for</strong> free online at http://w3schools.com/css/. You can also explore the elements of CSS at<br />

http://www.w3schools.com/css/css_reference.asp. When you have written your first style sheet and want to<br />

make sure it is structurally correct, you can validate it at http://jigsaw.w3.org/css-validator/.<br />

A very good book on creating a website using CSS is Build Your Own Web Site The Right Way Using HTML &<br />

CSS, Third Edition by Ian Lloyd, ISBN-13: 978-0987090850. You can get it at online and brick-and-mortar<br />

bookstores or from the publisher directly at http://www.sitepoint.com. (They also have digital editions of this and<br />

many of their other books.)<br />

Inheritance and Cascading<br />

Inheritance<br />

One of the most important concepts about CSS is that of inheritance.<br />

The elements of a web page can inherit their style in<strong>for</strong>mation from different sources, or can have a specific look<br />

all their own.<br />

Suppose you have a paragraph element with an emphasized word:<br />

The quick brown fox jumps over the lazy dog.<br />

If the em selector does not have a color assigned in your style sheet, it will inherit the color assigned to the p<br />

selector.<br />

(Because the element is nested inside the element, it is called a child element, and the is called<br />

the parent element. In the same way, most elements of a page are children of the element, and all<br />

elements, even , are children of the element.)<br />

Children don’t always inherit properties from their parents. More specifically, some properties (like color) are<br />

inherited, and some (like border properties) are not. If you have this style sheet<br />

body { border-style: solid; border-width: 5px; border-color: red; }<br />

then the border is applied around the entire page, not around each element in the page. If your goal is to have<br />

each paragraph surrounded by a thick red box, then you need to specify this rule <strong>for</strong> the p selector, not the body<br />

selector.<br />

- 76 -

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

Saved successfully!

Ooh no, something went wrong!