Locked lesson.
About this lesson
Exercise files
Download this lesson’s related exercise files.
Using CSS 3 Ways.docx58.6 KB Using CSS 3 Ways - Solution.docx
59 KB
Quick reference
Using CSS 3 Ways
There are basically three ways to use CSS on an HTML page.
When to use
Depending on what you are trying to achieve, you'll use one of these three CSS methods; inline CSS, internal stylesheets, or external stylesheets.
Instructions
Most often you will use an External CSS Stylesheet. You do that by generating this HTML tag in your <head> and </head> section:
<link rel="stylesheet" type="text/css" href="style.css">
From time to time you may use an internet stylesheet. Those look like this:
<style>
and
</style>
Anything between the <style> and </style> tags is CSS.
Finally, you can tweak an individual HTML element by using inline CSS, which looks like this:
<p style="color: blue;">
Where anything between the quotation marks is your css.
Order of precedence goes:
- inline css
- internal stylesheet
- external stylesheet.
Meaning, inline css over-rides internal sheets, which over-ride external sheets.
Hints & tips
- There are 3 main ways to use CSS
- Inline CSS
- Internal Stylesheets
- External Stylesheets
Lesson notes are only available for subscribers.