🏷️ HTML Tag

5th Grade 💻 Coding

A tag is a word inside angle brackets in HTML that labels what a part of the page is. Most tags come in pairs: an opening tag and a closing tag with a slash.

Free · US Letter · no sign-up
Google Classroom Save to Pinterest Email me

In <p>Some text</p>, <p> is the opening tag, </p> is the closing tag, and the text between them is the content. Common tags: h1 through h6 for headings, p for paragraphs, a for links, img for images, ul and li for lists, and button for buttons.

Tags can have attributes, which are extra information inside the opening tag. <a href="..."> says where a link goes, and <img src="..." alt="..."> says which picture to show and gives a description of it in words. An image tag has no closing tag. Tags can also sit inside each other, like li inside ul.

For example

  • <li>Milk</li> is one item on a shopping list inside a <ul>.
  • Sofia forgot the closing tag on a heading, and the whole page turned into one giant heading.
  • A link to a website: <a href="https://example.com">Visit the site</a>. The words “Visit the site” show on the page, and the address is tucked away in href.

📌 Remember: Opening tag, content, closing tag with a slash.

Quick quiz

  1. What is a tag in HTML?

  2. What does a closing tag look like?

  3. Which tag creates an item in a list?

🔎 Ask Thinkapedia another question