Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
This Fixing common HTML and CSS mistakes worksheet is part of the ACARA Digital Technologies Years 9–10 — Content, Structure and Presentation journey. Print it as a booklet?
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1<p>Welcome to my page | AThe closing brace is missing, so the rule is never closed and later rules may fail. Add } at the end. | |
| 2<link rel="stylesheet" href="styles/main.css"> | BLoads a stylesheet from a file path, which must match the real folder and file name or no styling is applied | |
| 3A CSS declaration must end with a semicolon and the rule must be closed with a brace | C<p class="note"> with .note { color: red; } | |
| 4The class name in the HTML must match the class selector in the CSS exactly, including spelling | DThe closing quote after cat.jpg is missing, so the attribute value runs on and the tag is read wrongly. Add the quote after cat.jpg. | |
| 5<img src="cat.jpg alt="A cat"> | Ep { color: blue; } | |
| 6h1 { color: green; background-color: yellow; | FThe paragraph has no closing tag, so the browser may treat the following content as part of the paragraph |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
debugging — Finding and fixing small slips in code, such as a missing closing tag, quote, semicolon or brace, or a class name that does not match. Check your code against the rules to spot each one.<p>Welcome to my page</p><p class="note">Check this</p>
.note { color: red; }h1 {
color: navy;
font-size: 32px; }p {
color: green;
}<link rel="stylesheet" href="style.css">