Skip to content

Beginner · HTML basics · topic 6 of 64 · 25 min

Headings, paragraphs and text

Explanation

Headings (h1 to h6) give a page its outline, and paragraphs hold the text. Tags such as strong and em add meaning, not just looks. Special characters like < and & are written as entities, and the browser turns extra spaces into one.

Headings: the outline of the page

HTML has six heading levels, from <h1> to <h6>. Use one <h1> for the main title of the page. Use <h2> for big sections and <h3> for parts inside an <h2> section. Do not skip levels, for example jumping from <h2> straight to <h4>.

Think of it like this: Think of a school textbook. The book title is the h1, each chapter is an h2, and each topic inside a chapter is an h3. Screen reader users jump from heading to heading the way you flip through chapters, so the order must make sense.
html
<h1>Class 12 Board Results 2026</h1>

<h2>How to check your result</h2>
<p>Enter your roll number and date of birth.</p>

<h2>Re-checking</h2>
<h3>Who can apply</h3>
<p>Any student who is not happy with a mark.</p>
<h3>Fees</h3>
<p>Rs 500 per subject.</p>
One h1, then h2 sections, then h3 parts
Careful: Never pick a heading level because of its size. If you want smaller or bigger text, change it with CSS. The level shows the place in the outline, not the font size.

Paragraphs and whitespace

Wrap each paragraph in <p>. Whitespace means spaces, tabs and new lines. The browser collapses whitespace: any run of spaces and new lines becomes a single space. So pressing Enter in your code does not start a new line on the page.

The <br> element forces a line break inside text where the line matters, such as a postal address or the lines of a poem. Use it sparingly. Do not use <br><br> to make space between paragraphs; use separate <p> elements and CSS margin instead.

Meaning, not looks: strong and em

TagMeaningDefault look
<strong>Very important, serious or urgentBold
<em>Stress that changes how a sentence is readItalic
<b>Draws attention, with no extra importance (a keyword)Bold
<i>A different voice: a technical term or a foreign wordItalic

Search engines and assistive tools read the tag, not the look. Choose the tag for its meaning. If you only want bold text for decoration, use CSS (font-weight) instead.

Quotes and code

html
<blockquote cite="https://www.example.org/speech">
  <p>Education is the most powerful tool to change a life.</p>
</blockquote>

<p>Use the <code>&lt;p&gt;</code> tag for paragraphs.</p>

<pre><code>Name:   Asha
Marks:  92</code></pre>
A long quote, a bit of inline code, and pre that keeps spaces

<blockquote> holds a long quote from another source, and <q> holds a short quote inside a sentence. <code> marks a piece of code. <pre> (preformatted) keeps every space and line break exactly as you typed it, so it is the exception to whitespace collapsing.

Character entities

Some characters have a special job in HTML. A < starts a tag and an & starts an entity. An entity is a short code that shows a character safely. Write &lt; for <, &gt; for >, and &amp; for &.

You writePage showsUse it for
&lt; and &gt;< and >Showing a tag as text
&amp;&Names like Tom &amp; Jerry, or URLs inside text
&nbsp;A space that never breaksKeeping a number and its unit on one line
&#8377; (or type ₹)₹The rupee sign; with UTF-8 you can type it directly
Tip: Put &nbsp; between a number and its unit so they never split across two lines on a small screen: ₹&nbsp;499 or 10&nbsp;km.

Watch the lesson

Headings, paragraphs and text · 1/6

Headings, paragraphs, meaning

Text is most of the web. Let us learn the tags that give text its structure and meaning.

Prefer a video by a teacher? Find free videos on “html headings paragraphs strong em entities tutorial for beginners” on YouTube ↗

In real life: An exam results notice

A university results page has one <h1> with the exam name, an <h2> for each faculty and an <h3> for each course. The last date for re-checking is inside <strong>, because missing it costs students money. The fee line is written as ₹&nbsp;500, so the sign and the amount never split on a phone screen, and the address of the exam office uses <br> between its lines.

Practice (0/3 done)

Task 1 · Code · HTML

This college notice uses two <h1> headings and no emphasis. Fix it: keep one <h1> ("College Notice"), change "Exam form" into an <h2>, and wrap the last date "25 November" in <strong> inside its paragraph.

Task 2 · Code · HTML

Two paragraphs show the wrong thing. In #rule, the text "<h1>" became a real heading: write it with entities so the page shows the tag as text. In #price, show the rupee sign and keep it on the same line as 499 with a non-breaking space, so the page shows "Price: ₹ 499".

Task 3 · Practice

Take one page of a newspaper or a school notice. Write its heading outline on paper: the one h1, the h2 sections and any h3 parts. Then mark which words deserve <strong> and which deserve <em>.

Quick quiz

Question 1

1.How many <h1> elements should a normal page have?

Question 2

2.You type five spaces between two words in your HTML. What does the page show?

Question 3

3.Which tag says that some text is very important?

Question 4

4.How do you show the text <p> on the page without making a paragraph?

Question 5

5.When is <br> a good choice?

Read more (free)

Pass the quiz (60% or more) or mark this topic as done when you are ready.

Your progress is saved on this device only.

← Previous: Page structure: the skeleton of every page