Aral Code

Text Lesson 8 of 42

HTML Text Formatting — Bold, Italic, Highlight and More

Format text in HTML with strong, em, b, i, mark, small, del, ins, sub and sup. Learn the difference between strong and b, and em and i.

Sometimes a word needs to stand out: a deadline, a warning, a scientific name, a chemical formula. HTML has small inline elements for each of these jobs. In this lesson you'll learn what they are and, just as important, when each one is the right choice.

The formatting elements at a glance

ElementMeaningDefault look
<strong>Very importantbold
<b>Draw attention, no extra importancebold
<em>Stress / emphasis (changes the meaning)italic
<i>Different voice: foreign words, names of ships, thoughtsitalic
<mark>Highlighted / relevanthighlight
<small>Side comments, fine printsmaller text
<del>Deleted textstrikethrough
<ins>Inserted textunderline
<sub>SubscriptH2O
<sup>Superscriptx2

strong vs. b

Both look bold, but they mean different things:

  • <strong> says "this is important." Screen readers may say it with more stress. Use it for warnings, deadlines, key facts.
  • <b> just makes text stand out without adding importance — like product names in a review or keywords in a summary.
Example strong for importance, b for attention
<p><strong>Deadline: Friday, 5:00 PM. Late projects will not be accepted.</strong></p>
<p>Today we tasted <b>Ube Halaya</b>, <b>Leche Flan</b> and <b>Buko Pandan</b>.</p>

em vs. i

<em> is emphasis — the kind of stress that changes the meaning of a sentence when you say it aloud. Compare these:

Example Emphasis changes the meaning
<p><em>I</em> didn't eat your baon.</p>
<p>I didn't eat <em>your</em> baon.</p>
<p>I didn't <em>eat</em> your baon.</p>

Each sentence means something different! The first says "someone else ate it." The second says "I ate someone else's baon." The third suggests "I only took it."

<i> is for text in an alternate voice: words from another language, scientific names, or a character's thoughts.

Example i for scientific names and foreign words
<p>The Philippine eagle (<i>Pithecophaga jefferyi</i>) is our national bird.</p>
<p>In English we say "thank you"; in Kapampangan, <i>dakal a salamat</i>.</p>

mark — highlighting

<mark> is like using a highlighter pen on your notes. It shows the part that is relevant right now, like a search term or the key point of a passage.

Example Highlight the key idea
<p>Photosynthesis happens in the <mark>chloroplasts</mark> of plant cells.</p>

del and ins — showing changes

Use <del> for text that was removed and <ins> for text that was added. Online shops use them for sale prices, and teachers use them to show corrections.

Example A sari-sari store sale
<p>Ice candy: <del>₱10</del> <ins>₱8</ins> today only!</p>
<p>The capital of the Philippines is <del>Quezon City</del> <ins>Manila</ins>.</p>

sub and sup — for science and math

<sub> lowers text below the line; <sup> raises it above. You need them for chemistry, math and dates.

Example Science and math formatting
<p>Water: H<sub>2</sub>O</p>
<p>Carbon dioxide: CO<sub>2</sub></p>
<p>Area of a square: A = s<sup>2</sup></p>
<p>Einstein's equation: E = mc<sup>2</sup></p>
<p>Philippine Independence Day: June 12<sup>th</sup></p>

small — fine print

Example small for side notes
<p>Registration fee: ₱150 <small>(includes snacks and certificate)</small></p>
<p><small>© 2026 Grade 10 Coding Club. All rights reserved.</small></p>

Combining elements

You can nest formatting elements. Just remember to close them in the right order.

Example Nested formatting
<p><strong>Reminder: bring your <em>own</em> water bottle.</strong></p>

Quick Quiz

Check what you learned. Walang grade ito, practice lang. 🙂

1. Which element marks text as very important?
2. How do you write H₂O correctly in HTML?
3. What is the best element for a scientific name like Mangifera indica?
4. Why should you avoid <u> for emphasis?
5. An item's old price was ₱50 and the new price is ₱40. Which pair is best?

By Sir Reyel · Last updated 2026-12-04