10.07.2017 Views

246996016-HTML5-Step-by-Step

Create successful ePaper yourself

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

98 Chapter 6<br />

2. In Notepad, in the area, add these rules:<br />

a:link {color: blue}<br />

a:visited {color: green}<br />

a:hover {color: lime}<br />

a:active {color: red}<br />

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

4. Position the mouse pointer over each hyperlink.<br />

Notice that hyperlink text is lime green when you position the mouse pointer over<br />

it. Diagnosing Foliage Problems is red because it is the active link.<br />

5. Click the hyperlink Glossary of Terms.<br />

Notice that the hyperlink text color changes to red immediately before the Glossary<br />

page loads. The Glossary page loads in its own separate window.<br />

6. Close the Glossary page window.<br />

Notice that the Glossary of Terms hyperlink is still red because it is still active. It was<br />

made active when you clicked it in step 5, and will remain so until you click something<br />

else.<br />

7. Click the hyperlink HTML Version, and then click Back.<br />

Notice that HTML Version is now red (active), but Glossary of Terms is green<br />

(visited).<br />

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

Creating and Linking to External Style Sheets<br />

Embedded style sheets work well for single-page Web sites, but to really take advantage<br />

of what cascading style sheets can do, you need to create an external style sheet. A<br />

single external style sheet can be linked to multiple documents, ensuring complete<br />

consistency even in a large site. An external style sheet also makes it easy to change the<br />

formatting of your site after the pages have been constructed. Rather than having to edit<br />

each page individually, you can simply change the style sheet.<br />

An external style sheet is a plain text file, just like an HTML file. The only difference is that<br />

you assign it a .css rather than an .htm extension. It contains anything you would place<br />

within the tag if you were creating the style sheet internally. You do not need the<br />

and tags themselves.

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

Saved successfully!

Ooh no, something went wrong!