HTML vs CSS: structure vs style, online
Six activities your students do on their own devices. See who's finished, and their scores.
HTML vs CSS: structure vs style in one minute
What students need to know
The <p> tag is a pure HTML content element - it places a paragraph on the page without any styling information. Setting font-size is a CSS concern - it changes how content looks, which is exactly what CSS is for.
HTML uses angle-bracket tags to mark up content. CSS uses selectors and property-value pairs instead. Font size is a CSS property. It belongs in a .css file, not in the HTML file.
Mistakes students make
- The <style> tag belongs inside <head>, not wrapping page content. Visible content should be inside <body>, not <style>.
- HTML elements cannot appear inside a CSS file. The <h1> tag belongs in an HTML file, not mixed into CSS rules.
- If <head> were missing or misspelled, the browser could not parse the document head correctly. The <link> to a stylesheet must sit inside a valid <head> element.
- color is a CSS property, not an HTML attribute. To style colour, use CSS: h1 { color: red; } rather than putting it inside the HTML tag.
What students will learn in this module
Every question in Module 2
Quick questions
- Which language controls the colour and font of text on a webpage?AHTMLBCSS
- Which language uses tags like <h1>, <p>, and <div>?AHTMLBCSS
- Which file would you use to change a heading's font size?Aindex.htmlBstyle.css
- True or false: HTML and CSS are the same language.AFalseBTrue
- Which tag connects an HTML file to an external CSS stylesheet?A<link>B<style>
Key terms
Students type the meaning of:
HTML
Match the pairs
<h1>Hello</h1>Match it to what it doesh1 { color: blue; }Match it to what it doesHTML defines what content is on the page, not how it looksMatch it to what it doesCSS controls visual appearance like colour, size, and layoutMatch it to what it does<p color="red">Text</p>Match it to what it doesh1 {
<p>Hello</p>
}Match it to what it doesFill in the blanks
<___>My Heading</h1>
Hint: Type the HTML opening tag name for a top-level heading
<p>Welcome</___>
Hint: Type the closing tag name that matches the opening paragraph tag
___ { color: red; }Hint: Type the HTML element selector that CSS is targeting
<link rel="stylesheet" href="___">
Hint: Type the filename of the CSS stylesheet being linked
<___> <h1>Title</h1> </body>
Hint: Type the HTML tag that wraps all visible page content
Spot the error
Question 1
A<!DOCTYPE html>B<html>C<style>D <h1>Hello</h1>E</html>
Question 2
Ah1 {B color: blue;C}D<h1>Hello</h1>
Question 3
A<head>B <link rel="stylesheet" href="style.css">C</head>D<body>E <p>Hello</p>F</body>
Question 4
A<body>B <h1 color="red">Title</h1>C <p>Some text</p>D</body>
Question 5
A<!DOCTYPE html>B<html>C<head></head>D<body>E <div>Content</div>F<html>
