Adding CSS to a Webpage
I’m studying for my Html / CSS class and need an explanation.
- With your text editor, create a new file and name it style.css
- In the <head> section of both HTML pages, add the following line:
<link rel=”stylesheet” href=”style.css”>
Comment: the filename is case-sensitive. Make sure that you use lowercase letters when referring to the style.css file.
- Back in the style.css file, write at least one CSS rules to style:
- 3 different tags
You can have more than three style rules to fit the vision you have imagined for the page; these are just the minimum.
- The style rules should apply to elements in all HTML pages that you created for your website.
- You may use properties you have learned about in class such as color, background-color, font, width/height, text decoration, borders, etc. Also try to use CSS rules that you haven’t seen in class, but discovered through your own reading.
- Save the style.css file in the same location as your website files.
- Link the style sheet to your home page.
- View the website to make sure that the style sheet is working.