HTML Elements and Tags

HTML elements are the building blocks of HTML pages. An HTML element is defined by a start tag, some content, and an end tag. Tags are not case sensitive, but lowercase is recommended.

Element Structure

Most HTML elements have the following structure:

<tagname>Content goes here...</tagname>

Some elements are self-closing (empty elements):

<tagname />

Common HTML Elements

Text Elements

Formatting Elements

Link and Navigation

Lists

Tables

Forms

Media Elements

Structural Elements

Block vs Inline Elements

Nesting Elements

HTML elements can be nested inside each other, but you must close them in the reverse order of how they were opened:

<p>This is a <strong>bold</strong> paragraph.</p>

Semantic HTML

Semantic elements clearly describe their meaning to both the browser and the developer. Examples include <header>, <footer>, <article>, <section>, etc. Using semantic HTML improves accessibility and SEO.

HTML5 New Elements

HTML5 introduced many new semantic elements: - <article> - <aside> - <details> - <figcaption> - <figure> - <footer> - <header> - <main> - <mark> - <nav> - <section> - <summary> - <time>

These elements provide better structure and meaning to web documents.

Loading