Tags are the building blocks of HTML, enclosed in angle brackets (e.g., <p>). An HTML Tag is the syntax used to mark the start or end of an element (e.g., <h1> and </h1>). An HTML Element is the complete unit: the start tag, the content inside, and the end tag (e.g., <h1>Welcome</h1>). Some tags are self-closing, like <img />. Tags can be nested, but they must be properly closed in the reverse order — no crossing. Attributes Attributes provide additional information to elements, placed in the opening tag as name="value" pairs. The Attribute Name is the property you want to set (e.g., href, src, style). The Attribute Value is the specific setting (always wrapped in quotes). Common Attributes id (unique identifier), class (for CSS/JS grouping), style (inline CSS — use sparingly), title…
Key Takeaways
Tag = syntax in angle brackets. Element = tag + content + closing tag.
Attributes are name="value" pairs in the opening tag.
id must be unique; class can be shared across elements.
Always use lowercase tags and quote attribute values.
Self-closing tags like <img /> do not need a closing tag.