LESSON 4

HTML Elements and Tags

Learning objective: Understand how elements, tags, and attributes fit together.

Understand

HTML is made of elements, and elements are written with tags.

Most elements have an opening tag, some content, and a closing tag, like <p>Hello</p>. Some elements are empty and self-close, like <br>. Tags can also carry attributes — extra information written as name='value' inside the opening tag.

Analogy: An element is like a labelled box: the tags are the label, and the content is what is inside.

See It in Action

This link element has content and an attribute:

<a href="https://bynteq.com">Visit Bynteq</a>
How it works: <a> is the element, href is an attribute giving the destination, and 'Visit Bynteq' is the visible content between the tags.

Try It Yourself

  1. Write a <p> element with some text.
  2. Add a title attribute to it, like title='hello'.
  3. Hover over the text in the browser to see the tooltip.

Quick Quiz

Where do attributes go?

Challenge

Create one element that uses at least one attribute and explain what the attribute does.

Success condition: You can point to the opening tag, content, closing tag, and attribute in your own element.