LESSON 02 / 04

Tags, Elements & Attributes

HTML is made of tags that wrap content. Learn opening and closing tags, nesting, attributes and the skeleton every page needs.

๐ŸŽ“Beginnerlevel
โฑ๏ธ30 minto finish
โœ๏ธ2activities

๐Ÿ“‚ HTML: The Structure๐Ÿท๏ธ HTML

๐ŸŽฏ By the end of this lesson you canโ€ฆ

  • Write opening and closing tags
  • Nest elements correctly
  • Add attributes to elements
๐ŸŒ HTML ยท CSS ยท JS nesting.html ๐Ÿ‘† Tap a line to explain it
1<h1>My favourite things</h1>2<h2>Food</h2>3<p>I love <strong>mango</strong> and <em>masala dosa</em>.</p>4<p>Line one<br>Line two</p>5<hr>6<p title="Hover me!">Hover over this paragraph.</p>
TagMeaning
<h1>โ€ฆ<h6>headings, biggest to smallest
<p>a paragraph
<strong> / <em>important / emphasised text
<br> / <hr>line break / divider (no closing tag)
<div> / <span>generic block / inline containers
๐Ÿž Find the error
What is wrong here?
1<p>This is <strong>very important</p></strong>
๐Ÿ› ๏ธ Mini profile

Make a page with an h1 of your name, an h2 saying About me, and a paragraph where one word is in <strong>.

๐Ÿ“Œ Key takeaways

  • <p>text</p> โ€” an opening tag, content, and a closing tag with /.
  • Tags nest like boxes inside boxes: close the inner one first.
  • Attributes add extra information: <a href="โ€ฆ">, <img src="โ€ฆ" alt="โ€ฆ">.

Finished reading & practising?

Saved in this browser. Create a free account to keep it forever.