10.07.2017 Views

246996016-HTML5-Step-by-Step

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

100 Chapter 6<br />

5. Save the new document as default.css in the practice file folder for this exercise<br />

(Documents\Microsoft Press\<strong>HTML5</strong> SBS\06Styles\CreatingExternal).<br />

6. Return to the index file in Notepad, and then delete the and tags.<br />

7. Add this line to the section:<br />

<br />

8. Save the file, and then refresh the Internet Explorer display.<br />

The file does not appear to change, but the styles are now defined in the external<br />

style sheet rather than in the embedded style sheet.<br />

Note One way to quickly check whether the style sheet is applied is to position the<br />

mouse pointer over a hyperlink. If the style sheet is working, the hyperlink text will turn<br />

lime green.<br />

CLEAN UP Close the Notepad and Internet Explorer windows.<br />

Key Points<br />

●<br />

●<br />

●<br />

Styles can define the formatting for specific instances of a tag, for all uses of a tag<br />

within a document, or for all uses of a tag within a group of documents.<br />

A cascading style sheet is a list of style rules applied to tags within an HTML document.<br />

This list can either be internal (embedded) or external to the document (a<br />

linked file).<br />

When rule conflicts occur, they are resolved as follows (from highest priority to<br />

lowest):<br />

❍<br />

❍<br />

❍<br />

Styles applied to individual tags<br />

Styles applied using an internal style sheet (with highest priority going to the<br />

entries nearest the bottom of that style sheet)<br />

Styles applied using an external style sheet (again, with highest priority to<br />

the entries nearest the bottom)

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

Saved successfully!

Ooh no, something went wrong!