CSS 2 : Styling with fonts and colors
Get Set Up
- Copy the CSS 2 folder from the Outbox.
- Paste it into your root folder.
- Rename it "lastname CSS 2", where lastname is your actual last name.
In the CSS 2 folder, you will find
- A fresh copy of the "Segway'n USA " Web site (journal folder)
- The CSS 2 lesson in PDF format
Exercise 1 [p.349-350]
- Read pages 341-350 of the Lesson.
- Create a new file in Notepad. Save it as "journal.css" in the "journal" folder in your "lastname CSS 2" folder.
- Add the body rule and save the file.
- Open "journal.html" in Notepad.
- Add the <link> tag inside the <head> element.
<link type="text/css" rel="stylesheet" href="journal.css" />
- Save and test "journal.html" in the browser.
Exercise 2 [p.356-357]
- Read pages 351-357 of the Lesson.
- In "journal.css", add the font-size property to the body rule.
- Create two new rules for h1 and h2.
- Save "journal.css", and test "journal.html" in the browser.
Exercise 3 [p.359-360]
- Read pages 358-360 of the Lesson.
- In "journal.css", create an h1, h2 rule and set the font-weight property for it.
- Save "journal.css", and test "journal.html" in the browser.
Exercise 4 [p.362]
- Read pages 361-362 of the Lesson.
- In "journal.css", create a blockquote rule and set the font-style property for it.
- Save "journal.css", and test "journal.html" in the browser.
Exercise 5 [p.375-376]
- Read pages 363-376 of the Lesson.
- In "journal.css", add the color and text-decoration properties to the h1, h2 rule.
- Save "journal.css", and test "journal.html" in the browser.
Exercise 6 [p.378]
- Read pages 377-379 of the Lesson.
- In "journal.css", delete thetext-decoration properties from the h1, h2 rule.
- Add the border-bottom property to the h1, h2 rule.
- Save "journal.css", and test "journal.html" in the browser.
Exercise 6 - This is worth half the grade!
- Check "journal.css" in W3C's CSS Validator (http://jigsaw.w3.org/css-validator/) .
- Ignore the warnings, but fix any and all errors. Then retest. You're good if you don't see a red error badge across the top of your results.
Turn in Your Files
- In My Documents, navigate down into your root folder.
- Right-click on your "lastname CSS 2" folder and select Copy.
- Navigate to the Inbox.
- Right-click on the "CSS 2 " folder and select Paste.
Source: "Head First HTML: with CSS & XHTML" by Elisabeth Freeman and Eric Freeman