previous page

Overview | Create Files | Create CSSl | Attach CSS | Add to CSS | Misinformation Page | Disclaimer Page | Turn in Work

next page

Project 1B website of misinformation

Attach your style sheet to your pages


To attach your style sheet to your two HTML pages, you will use an HTML code that goes in the <head> section of the HTML page.

1. Open your "project1b_hoax.html" page in NotePad++ if it isn't already open.

2. Go to the <head > section and type a link tag like this:

<link rel="stylesheet" type="text/css" href="hoax.css" />

This tag links the stylesheet to this page.

The "rel" attribute explains the "relationship" to this page

The "type" attribute explains the type of file that is being linked

the "href" attribute gives the name of the file (href stands for hypertext reference)

3. Preview the page in your Web browser.

If it didn't work:

check to be sure you saved the css file in the same place as the html file and be sure the name of the css file is correct

check to see if there are already style definitions embedded in the page (more info about this here)

 

4. Now open your "site-disclaimer.html" page and follow the steps 2 & 3 again to attach this same stylesheet to that page.

 

Think about what you just did. This was efficient—you only had to type the colors in one place and you applied it to 2 pages. You could also apply it to many more. And...if you decide to change the background color, you can change it in just one place (in the css file) and all of the HTML pages will now have the new color.

Next, you'll add one more element to your css file.

previous page   next page