Creating text-based elements
HTML provides us with a variety of elements that are used for text-based content. While browsing the web, you might have noticed that web pages typically have similar text-based content. Most web pages will contain a page heading. The content will typically comprise headings, paragraphs, and lists. HTML equips you with tools to format such elements within a web page.
In this section, we will be looking at the following HTML text-based elements:
- Headings
- Paragraphs
- Inline text elements
- Lists
Headings
Heading elements in HTML offer six levels of hierarchy, ranging from h1
to h6
. Now, h1
is typically only used once on a page, as it is the topmost heading for the document as a whole. The following code snippet shows how all of these headings are used and what they look like in the browser by default:
<h1>Heading level 1</h1> <h2>Heading level 2</h2> <h3>Heading level 3</h3> <h4>Heading...