Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 1.1 — Elements, Tags and Attributes
HTML · Example 3 of 3

Quotes, duplicates and case

Unquoted values and uppercase names work, but write lowercase names and double quotes. The second class is thrown away.

An element is one piece of a page, written as an opening tag, some content and a closing tag; attributes inside the opening tag add extra settings like an id, a link address or an on/off switch.

Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.

Ready for more? This phase has 5 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

Write a paragraph with the id intro and the class lead, containing the text Welcome to my page where the word my is emphasised.

02

Write a text box (<input>) that is disabled and required, using boolean attributes correctly. Then write how you'd make it enabled again in HTML.

03

Find and fix the two mistakes: <p>Read <a href=about.html>about me</p></a><br></br>

Explain it without notes

01

What is the difference between an element, a tag and an attribute?

02

What is a void element? Name five.

03

How do boolean attributes work, and why doesn't disabled="false" enable a button?

04

What happens when you put a <div> inside a <p>?

Quotes, duplicates and case

Preview

Press Run to see the page.

Console

Nothing logged yet.

Expected console output

title: single quotes work
id (unquoted): plain
class (written twice): first
Attribute names: title, id, class