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.

Discover other journeys with this module

What students will learn in this module

Every question in Module 2

Quick questions

  1. Which language controls the colour and font of text on a webpage?AHTMLBCSS
  2. Which language uses tags like <h1>, <p>, and <div>?AHTMLBCSS
  3. Which file would you use to change a heading's font size?Aindex.htmlBstyle.css
  4. True or false: HTML and CSS are the same language.AFalseBTrue
  5. 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 does
h1 { color: blue; }Match it to what it does
HTML defines what content is on the page, not how it looksMatch it to what it does
CSS controls visual appearance like colour, size, and layoutMatch it to what it does
<p color="red">Text</p>Match it to what it does
h1 {
  <p>Hello</p>
}
Match it to what it does

Fill in the blanks

  1. <___>My Heading</h1>

    Hint: Type the HTML opening tag name for a top-level heading

  2. <p>Welcome</___>

    Hint: Type the closing tag name that matches the opening paragraph tag

  3. ___ { color: red; }

    Hint: Type the HTML element selector that CSS is targeting

  4. <link rel="stylesheet" href="___">

    Hint: Type the filename of the CSS stylesheet being linked

  5. <___>
      <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>