HTML elements are the building blocks of all web pages. They define what type of content appears on a page and how it is structured.
Every HTML page is a document composed of specific elements. The most important ones include <html>, <head>, <title>, and <body>.
Below are some commonly used HTML elements that every beginner should know.
<p> β Represents a paragraph of text.<h1> β <h6> β Defines headings from the largest (<h1>) to the smallest (<h6>).<a> β Defines a hyperlink or link.<img> β Used to display images.<div> β A block-level container used for structuring content.<span> β An inline element used for styling.Here are a few simple examples of what these elements look like in practice.
Code Details
<p>This is a paragraph.</p>
<h1>This is a heading</h1>
Preview
This is a paragraph.
HTML elements can be either block-level (like <div>) or inline (like <span>). Block-level elements start on a new line, while inline elements do not break the flow of the text.
HTML allows elements to be nested within each other. Itβs important that the nesting is logical and correct β donβt close elements too early or too late.
β¨ Ask Lara β your AI study partner
Unlock personalized learning support. Lara can explain lessons, summarize topics, and answer your study questions β available from the Go plan and above.
Lara helps you learn faster β exclusive to ReadyTools Go, Plus, and Max members.