HTML Headings & Paragraphs
Master the art of using HTML headings and paragraphs to structure and format your web content
HTML headings and paragraphs are essential elements that contribute to the organization and structure of web content. Headings serve as titles and subtitles, guiding users through the information and drawing their attention to important topics.
By utilizing appropriate heading tags, you can create a hierarchy that enhances the readability and navigability of your web page.
In addition to headings, HTML paragraphs play a pivotal role in presenting textual content in a coherent and digestible manner. By enclosing paragraphs within the appropriate HTML tags, you establish clear boundaries for blocks of text, making it easier for users to follow along and comprehend the information presented.
There are 6 types of <h1>
to <h6>
that designers can use for titles and subtitles on a web <h1>
defines the most important
Just like having several cooks in a kitchen is never a good thing, you should avoid using <h1>
more than once per page. Otherwise, it may confuse and disorient search engines and screen readers.
The <h6>
tag has the lowest rank and represents the least important </h6>
with no spacing, or the whole formatting effort will be for nothing. The truth is that most <h4>
Headings help organize
Keeping accessibility and usability in mind, try to maintain the <h2>
to <h5>
. Sometimes, it's okay to revert the order and use <h2>
after <h5>
if the
Headings are for titles and subtitles. Using <h>
<b> </b>
tags violates
Just like most other <h1>
Headings create a structured outline for the <h>
Visually, you can style text with
A paragraph is a block of text that starts from a new line. In the <p>
element to define a paragraph, and browsers automatically add some white space before and after it. Keep in mind that the <p>
element is a container, and it should have the start <p>
and end </p>
Let's confess — we've all added paragraphs in word documents by adding extra spaces or extra lines using a spacebar. The
Use the <br>
To start a new chapter in a book or a new topic in a term paper, you might need a break, and a paragraph is not enough. The <hr>
<hr>
is an empty tag, which means it doesn't require an end tag.
The <br>
element introduces the line break. This means that without this <br>
tag is an empty one, so you don't have to worry if you closed it. It's also an inline element that isn't as greedy as block-level elements, so it only takes up as much width as necessary.
Remember, when we told you that browsers have no remorse for extra spaces and lines and display the <pre>
(pref-formatted) element finds a way around this rule and allows developers to keep preformatted text and present it exactly as written in the
The <p>
element represents paragraphs that are usually adjacent blocks of text but also can be any piece of related <p>
<p>
tag usually requires closing, but paragraphs are block-level elements, and will automatically close if another block-level element follows before the closing </p>
tag.
Let's say you have a dramatic change of scene in a story or a topic shift within a final paper section. Which <hr>
The <br>
<br>
starts from a new line, and you don't have to worry about closing the tag — it's an empty one.[5]
The <pre>
element defines preformatted text and allows you to present text with a typewriter effect. As you can see from the example, it keeps all extra spaces and lines and uses monospaced <pre>
tag to present poetry, create ASCII art, or show code structure. Keep in mind that both start <pre>
and end </pre>