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.

Cascading<br />

Style rules can be defined in multiple places:<br />

• Inline style sheets are defined in the HTML element tag itself, and apply only to that tag and its children.<br />

• Internal style sheets are defined in the element of an HTML page, and apply to everything on that<br />

page.<br />

• External style sheets are defined in a separate document and can be attached to an HTML page by being<br />

linked to the page in the element. The same external style sheet can be linked to all the pages in<br />

a website, allowing them all to use the same style rules.<br />

• The browser (or user agent) has an internal style sheet <strong>for</strong> displaying websites that don’t have their own.<br />

Browsers often let their users supply their own style sheet to override its default style rules.<br />

Cascading works in this order:<br />

1. If a tag has an inline style sheet, use that;<br />

2. Otherwise, if a page has an internal style sheet, use that;<br />

3. Otherwise, if a page uses an external style sheet, use that;<br />

4. Otherwise, use the browser’s style sheet.<br />

NOTE: If a page includes both an internal style sheet and an external style sheet, the cascade order follows the<br />

order they are referenced in the HTML document: if the external style sheet is referenced after the internal, its<br />

definitions will have precedence.<br />

If this is a fragment of a page<br />

<br />

<br />

<br />

p { font-size: 10pt; color: green; }<br />

<br />

<br />

<br />

<br />

Now is the time <strong>for</strong> all good men...<br />

to come to the aid of their<br />

party.<br />

<br />

<br />

and the file mystyles.css contains this rule<br />

p { font-size: 14pt; }<br />

The page will look something like this:<br />

Now is the time <strong>for</strong> all good men<br />

to come to the aid of their party.<br />

The first paragraph gets its color (green) from the internal style sheet, but the size (14pt) comes from the<br />

external style sheet (since it is referenced last, the size definition here has precedence). The color and size of the<br />

second paragraph are defined inline in the tag and override the other definitions.<br />

Since we didn’t specify a font, this comes from the browser’s default font definition.<br />

It is perfectly legal and reasonable to include more than one external style sheet link in a web page. If this results<br />

in a conflict, the styles defined in the last-linked style sheet have precedence. Similarly, if you have these rules in<br />

a style sheet<br />

p { font-size: 10pt; color: red; }<br />

...<br />

p {font-size: 12pt; }<br />

then your paragraph text will be 12pt and red.<br />

- 77 -

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

Saved successfully!

Ooh no, something went wrong!