90-minute class plan
- 0–10 min — Opening and visual warm-up: Introduce the learning goals, review the previous class, and discuss a relevant website example.
- 10–25 min — Mini-lesson: Explain the key concepts and show examples. Keep the presentation focused on what students will apply.
- 25–45 min — Instructor demonstration: Walk through the interactive CodePen or a live example. Pause for predictions and questions.
- 45–70 min — Guided and independent practice: Students complete the lesson exercise, first following a short demonstration and then making their own decisions.
- 70–83 min — Apply and critique: Students connect the skill to their website project, compare results with a partner, and make one improvement.
- 83–90 min — Share-out and exit ticket: Review key takeaways and ask students to identify one thing they learned and one next step.
Course: Introduction to Web Design
Week: 4
Learning objectives
By the end of this lesson, you should be able to:
- Explain the relationship between HTML and CSS.
- Modify common CSS properties including color, padding, border radius, and text alignment.
- Predict how a CSS change will affect a component.
Key concepts
CSS stands for Cascading Style Sheets. It controls how HTML elements appear: colors, spacing, typography, borders, layout, and responsive behavior.
A CSS rule typically includes a selector and declarations. The selector identifies what to style; each declaration pairs a property with a value. For example, padding: 24px; creates space inside an element, while border-radius: 12px; rounds its corners.
Good CSS is intentional and consistent. Designers often build reusable rules that establish a visual system.
Interactive demonstration
Demo file: 04-css-rule-playground.html
Change the preview’s background, text color, padding, corner radius, alignment, and font weight. Read the generated CSS after each change.
See the Pen 04-css-rule-playground by Nicholas D’Angelo (@ndangelo) on CodePen.
Create three visual variations of the same card component. Change no more than three properties in each version. Compare which version best supports the intended message and explain why.
Connection to your website project
Save your preferred CSS decisions for the midterm site’s visual direction.
Sublime Text coding lab
Complete this coding task in Sublime Text, save the files using the names below, and open the HTML page in a browser to test it.
Today’s coding focus
External CSS, selectors, declarations, properties, values, and debugging
Project files and folder structure
Create week-04/index.html and week-04/css/styles.css; link the stylesheet with a relative path.
Syntax to practice
CSS rule syntax selector { property: value; }; element and class selectors; braces, colons, semicolons; <link rel="stylesheet" href="css/styles.css">.
Build it
Style the Week 3 profile page with background and text colors, base font, content width, spacing, and a distinct heading. Intentionally remove one semicolon, observe the effect, and fix it.
Code along: Connect HTML to an external stylesheet and practice selectors.
Open in Sublime Text: week-04/css/styles.css
Type the example below, save the file, and read the comments and selectors carefully. Use this as a starting point, then modify it for your own project.
body {
margin: 0;
padding: 24px;
font-family: Arial, sans-serif;
color: #222222;
background: #f4f4f4;
}
h1 { color: #2457a7; }
.intro { font-size: 1.2rem; line-height: 1.6; }
.card { padding: 20px; background: white; border: 1px solid #ccc; }
Complete HTML and CSS example
These are matching files. Create the folders shown below, save each code sample using the exact filename, and keep the stylesheet link consistent with your folder structure.
HTML file: week-04/index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CSS Fundamentals</title>
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<main>
<h1>CSS Fundamentals</h1>
<p class="intro">HTML gives content structure; CSS controls presentation.</p>
<section class="card"><h2>Practice</h2><p>Change the selector and observe the result.</p></section>
</main>
</body>
</html>
CSS file: week-04/css/styles.css
body { margin: 0; padding: 24px; font-family: Arial, sans-serif; color: #222; background: #f4f4f4; }
h1 { color: #2457a7; }
.intro { font-size: 1.2rem; line-height: 1.6; }
.card { padding: 20px; background: white; border: 1px solid #ccc; border-radius: 8px; }
Important: The HTML links to css/styles.css. Keep that path correct relative to the HTML file.
Modify it
Add class=”intro” to a paragraph and class=”card” to a section. Change the heading color.
Save and test
- Save the file in the exact folder shown above.
- Open the HTML file in a browser, or refresh it after saving if it is already open.
- Check that linked CSS, images, and navigation work. If something fails, inspect filenames, capitalization, nesting, and relative paths.
Assignment and required deliverables
Submit every item below. Use the specified filenames and folder structure. A screenshot does not replace a required source file.
Required files
week-04/index.html— profile page linked to external CSS.week-04/css/styles.css— at least six declarations across four or more rules.week-04/README.txt— explain element, selector, property, and value.
Submission checklist
- Stylesheet loads; six or more declarations; four or more rules; README defines all four terms.
- Keep all HTML, CSS, image, text, and PDF files inside the named weekly or project folder.
- Open the HTML file in a browser before submitting and confirm linked CSS and images load.
Before you leave (3-minute exit check)
Write down one thing you changed, one thing you learned from the result, and one question you still have.
These references support the key concepts and practices covered in this lesson. They are provided for verification and further study.
- Mozilla Contributors. (n.d.). *CSS styling basics*. MDN Web Docs. https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Styling_basics
- Mozilla Contributors. (n.d.). *CSS selectors*. MDN Web Docs. https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_selectors
- Mozilla Contributors. (n.d.). *Getting started with CSS*. MDN Web Docs. https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Styling_basics/Getting_started