Unordered
- Valid HTML
- Clean structure
- Good alt text
Everything we used in class, nothing fancy.
<header>, <nav>, <main>, <section>, <footer><figure> + <figcaption><h1> per page, then <h2>, <h3>…
p { color: #222; })border, padding, margin<head> with <link>| Selector | Matches | Example Rule |
|---|---|---|
p | All <p> elements | p { color:#222; } |
.note | Any element with class="note" | .note { background:#fffbe6; } |
#main-title | Element with id="main-title" | #main-title { font-size:28px; } |
nav a | <a> inside a <nav> | nav a { text-decoration:none; } |
Every element is a box: content → padding → border → margin.
| Property | What it Does | Example |
|---|---|---|
padding | Space inside the border | padding:12px; |
border | Line around the element | border:1px solid #ddd; |
margin | Space outside the border | margin:10px; |
width | Content width | width:300px; |
Tip: We used * { box-sizing:border-box; } so width includes padding + border.
<nav>).<figcaption> for images.| Tag | Purpose | Example |
|---|---|---|
<meta charset="utf-8"> | Text encoding | Prevents weird characters |
<meta name="viewport"> | Mobile sizing | width=device-width,initial-scale=1 |
<title> | Tab title | <title>My Page</title> |
<link> | CSS file | <link rel="stylesheet" href="css/style.css"> |
| Element | Use | Notes |
|---|---|---|
<figure> |
Wrap an image | Pair with <figcaption> |
<nav> |
Navigation links | Use meaningful link text |
<table> |
Tabular data | Use <caption>, <thead>, <tbody>, scope |
<img> |
Images | Always include alt |
css/, img/)../ then down to the target<img src="logo.png" alt="Logo">
<img src="img/logo.png" alt="Logo">
<img src="../img/logo.png" alt="Logo">
| Image | Good Alt | Avoid |
|---|---|---|
| Logo | alt="Sheridan College logo" |
alt="image123.png" or missing alt |
| Decorative divider | alt="" (empty alt = decorative) |
Writing a long description for decoration |
| Screenshot of a page title | alt="Web Dev 1 Homepage" |
“picture” or “screenshot” |
| Tag | Purpose | Notes |
|---|---|---|
<header> | Top of page/section | Often contains site title + nav |
<nav> | Navigation | Group of links |
<main> | Primary content | One per page |
<section> | Topical grouping | Use headings inside |
<figure> | Image + caption | Use with <figcaption> |
<table> | Tabular data | Use <caption>, <thead>, <tbody>, scope |
<footer> | Page/section footer | Copyright, links |
| Issue | Why | Fix |
|---|---|---|
| Images don’t load online | Wrong path / wrong case | Check folder, use relative path, match file name case |
| CSS not applying | Wrong link path | <link rel="stylesheet" href="css/style.css"> (or ../css/style.css) |
| Weird symbols | Missing charset | Add <meta charset="utf-8"> |
| Headings look odd | Skipped levels | Keep logical order: h1 → h2 → h3 |
css/style.css.html/index.html to img/logo.png.alt="" appropriate?<figure> + <figcaption>.