HTML Basics for Beginners Text Formatting (HTML Tutorial #2.2)

HTML Text Formatting for Beginners: Quotes, Code & Special Characters (Part 2)

Hey friend! ๐Ÿ‘‹

Welcome back to our HTML Basics for Beginners series!

  • Make text bold and italic
  • Underline, highlight, and small text
  • Show deleted and inserted text
  • Use line breaks and dividers

And honestlyโ€ฆ your page already looks MUCH better now ๐Ÿ˜„

But today?

Weโ€™re taking it to the next level โ€” the โ€œreal websiteโ€ level. ๐Ÿš€

What Youโ€™ll Learn Today

By the end of this tutorial, youโ€™ll be able to:

โœ… Add quotes like a pro
โœ… Give proper credit using citations
โœ… Show code on your webpage (super important!)
โœ… Use special characters like ยฉ, <, >
โœ… Write formulas using subscript & superscript
โœ… Build a mini project: Book Review Page

Let’s make your text look like a professional website!๐Ÿ”ฅ

Before You Start

Ready? Let’s dive in!

Step 1: Quotes in HTML (Make Your Content Feel Real)

Sometimes, the text on your page is not yours.

Maybe itโ€™s:

  • A famous quote
  • Something your teacher said
  • A line from a book
  • An article or website

HTML gives us special tags to show quotes properly and give credit.

Short Quotes โ†’ <q>

Use <q> for small quotes inside a sentence.

See the Pen Codeboid โ€“ HTML Tutorial #2 โ€” by Codeboid (@Codeboid) on CodePen.

What <q> does:

  • Adds quotation marks automatically
  • Keeps the sentence flowing naturally

๐ŸŒ Browser Magic: You don’t type the ” ” marks yourself. The browser adds them automatically when it sees <q>.

When to Use <q>

  • Small quotes
  • Single sentences
  • Dialogue inside a paragraph

๐Ÿ’ก Think of <q> as:
Quotation marks inside a sentence.

Long Quotes โ†’ <blockquote>

Now imagine a BIG quote.

Something important.

Something that deserves its own space.

Use <blockquote> when the quote is long or needs attention.

See the Pen Codeboid โ€“ HTML Tutorial #2 โ€” by Codeboid (@Codeboid) on CodePen.

What Happens?

  • It moves to a new line
  • Adds spacing
  • Looks important

When to use <blockquote>:

  • Famous quotes
  • Paragraph-length quotes
  • Important statements or testimonials

๐Ÿ’ก Think of <blockquote> as:
๐Ÿ‘‰ โ€œPause. This is important.โ€

<q> vs <blockquote>

TagUse
<q>Small quotes inside text
<blockquote>Big quotes (separate section)

Add Credit โ†’ <cite>

Now hereโ€™s where beginners often make a mistake โŒ

They add quotesโ€ฆ but donโ€™t give credit.

Letโ€™s fix that.

See the Pen Codeboid โ€“ HTML Tutorial #2 โ€” by Codeboid (@Codeboid) on CodePen.

What <cite> does:

  • Shows the source of the quote
  • Gives credit to the author or work

๐Ÿ’ก Simple rule:
Quote + Cite = Trust

Best Practice (VERY IMPORTANT)

Most of the time, you’ll use quotes and citations together.

See the Pen Codeboid โ€“ HTML Tutorial #2 โ€” Quotes & Citations by Codeboid (@Codeboid) on CodePen.

๐Ÿ‘‰ This makes your page:

  • More professional
  • More trustworthy
  • More readable

This clearly tells the reader:

  • These words are quoted
  • Who said them

Clean. Professional. Respectful.

Real-Life Example (Blog Style)

See the Pen Codeboid โ€“ HTML Tutorial #2 โ€” Quotes & Citations (Blog Style) by Codeboid (@Codeboid) on CodePen.

Important Tips โš ๏ธ

โŒ Don’t use quotes just to make text look fancy
โŒ Don’t forget to give credit

โœ… Use quotes when the words are not yours
โœ… Always mention the source if possible

Practice Challenge ๐ŸŽฏ

Add your favorite inspirational quote using <blockquote> and credit the author with <cite>.

Step 2: Special Characters & HTML Entities

Hereโ€™s something that confuses beginners A LOT.

Some characters have special meaning in HTML (<, >, &).
To display them as text, use HTML entities.

If you use them normally, HTML gets confused ๐Ÿ˜ต

Why Do We Need HTML Entities?

Imagine you want to show someone how to write HTML code on your webpage.

The Problem

This breaks your page โŒ

Because <p> is treated as a real tag.

The Solution โ†’ HTML Entities

๐Ÿ‘‰ Output: Use the <p> tag

Common HTML Entities

SymbolCodeDescription
<&lt;Less than
>&gt;Greater than
&&amp;Ampersand
&quot;Quotation mark
&apos;Apostrophe
ยฉ&copy;Copyright symbol
ยฎ&reg;Registered trademark
โ„ข&trade;Trademark
โ‚ฌ&euro;Euro
ยฃ&pound;Pound sterling
ยฅ&yen;Yen
(space)&nbsp;Non-breaking space

Examples:

See the Pen Codeboid โ€“ HTML Tutorial #2 โ€” HTML Entities by Codeboid (@Codeboid) on CodePen.

Result on webpage:

  • To write HTML tags, use <p> and </p>.
  • Copyright ยฉ 2026 My Website. All rights reserved.
  • Coca-Colaยฎ is a registered trademark.
  • Price: โ‚ฌ49.99
  • Ben & Jerry’s

๐Ÿ’ก Simple Rule:
๐Ÿ‘‰ If it looks like HTMLโ€ฆ escape it

When to Use Entities:

โœ… Displaying HTML code examples
โœ… Adding copyright/trademark symbols
โœ… Showing mathematical symbols
โœ… Preventing words from breaking across lines (&nbsp;)

Practice Challenge ๐ŸŽฏ

Create a footer with a copyright symbol, the current year, and your name.

Step 3: Show Code on Your Website

Now comes the FUN part ๐Ÿ˜„

Now that you know about HTML entities, let’s learn how to display code!

Inline Code โ†’ <code>

Use <code> when you mention small pieces of code inside a sentence.

See the Pen Codeboid โ€“ HTML Tutorial #2 โ€” by Codeboid (@Codeboid) on CodePen.

What It Does

  • Changes font (monospace)
  • Makes code stand out

When to use <code>:

  • Tag names (p, h1, div)
  • Function names (print, alert)
  • Variable names
  • File names (index.html)

๐Ÿ’ก Think of <code> as saying:
“This is code โ€” don’t read it like a sentence.”

Displaying HTML Code with Entities

Now you can show HTML tags safely!

See the Pen Codeboid โ€“ HTML Tutorial #2 โ€” + HTML Entities by Codeboid (@Codeboid) on CodePen.

Multi-line Code โ†’ <pre>

Want to show full code?

Use <pre>:

See the Pen Codeboid โ€“ HTML Tutorial #2 โ€” by Codeboid (@Codeboid) on CodePen.

Best Practice โ†’ <pre> + <code>

See the Pen Codeboid โ€“ HTML Tutorial #2 โ€” + by Codeboid (@Codeboid) on CodePen.

This safely displays HTML code without breaking your page!

Why use both tags together?

  • <pre> keeps spacing and line breaks
  • <code> tells the browser this is code

๐Ÿ’ก Remember:

  • <code> = this is code
  • <pre> = keep formatting

Practice Challenge ๐ŸŽฏ

Display<h1>, <h2>, <p> tags using <pre> and <code>.

Step 4: Keyboard Keys โ†’ <kbd>

This one is super fun ๐Ÿ˜„

See the Pen Codeboid โ€“ HTML Tutorial #2 โ€” by Codeboid (@Codeboid) on CodePen.

๐Ÿ‘‰ Output looks like keyboard buttons

Use it for:

  • Shortcuts
  • Instructions
  • Tutorials

Step 5: Subscript & Superscript

Subscript โ†’ <sub>

Subscript text appears slightly lower than normal text.

See the Pen Codeboid โ€“ HTML Tutorial #2 โ€” by Codeboid (@Codeboid) on CodePen.

When to use <sub>:

  • Chemistry formulas (Hโ‚‚O, COโ‚‚)
  • Math equations
  • Footnote markers

๐Ÿ’ก Think of <sub> as:
“This number belongs below.”

Superscript โ†’ <sup>

Superscript text appears slightly higher than normal text.

See the Pen Codeboid โ€“ HTML Tutorial #2 โ€” by Codeboid (@Codeboid) on CodePen.

When to use <sup>:

  • Powers and exponents (2ยณ, xยฒ)
  • Ordinal numbers (1หขแต—, 2โฟแตˆ)
  • Footnote references

๐Ÿ’ก Think of <sup> as:
“This number belongs above.”

Example Together

See the Pen Codeboid โ€“ HTML Tutorial #2 โ€” + by Codeboid (@Codeboid) on CodePen.

Practice Challenge ๐ŸŽฏ

Write Einstein’s famous equation (E=mcยฒ) and the chemical formula for water (Hโ‚‚O).

Mini Project: Book Review Page ๐Ÿ“š

Now letโ€™s combine EVERYTHING you learned in Parts 1 and 2!

Create a file called book-review.html:

What’s Happening in This Code:

Here’s a quick overview of every tag in this project and what it does โ€” so nothing surprises you in the code!

โœ… <h1>, <h2>, <h3> โ†’ Page headings and sections
โœ… <strong> โ†’ Bold (author name, rating, key phrases)
โœ… <em> โ†’ Italic emphasis (“could not put it down”)
โœ… <i> โ†’ Italic for the book title
โœ… <mark> โ†’ Highlight important phrases
โœ… <small> โ†’ Footer and disclaimer text
โœ… <hr> โ†’ Visual dividers between sections
โœ… <blockquote> โ†’ Display the favorite quote
โœ… <cite> โ†’ Credit the quote to the author
โœ… <sup> โ†’ Star rating as superscript
โœ… <code> โ†’ Mention a tag name inline
โœ… <pre><code> โ†’ Show a multi-line code block
โœ… &lt; and &gt; โ†’ Safely display HTML tags as text
โœ… &copy; โ†’ Copyright symbol in the footer

Your Turn! ๐ŸŽฏ

Customize this page:

  1. Change the book to YOUR favorite book
  2. Write your own honest review
  3. Add your favorite quote from the book
  4. Include a code example showing an HTML tag
  5. Use special characters in the footer
  6. Add chemistry formulas or math equations if relevant

๐Ÿ‘‰ Open it in your browser and admire your work!

Cheat Sheet (Save This!)

Quick Recap

Today you learned:

โœ… How to format quotes with <q> and <blockquote>
โœ… How to give credit with <cite>
โœ… How to use HTML entities for special characters
โœ… How to display code with <code> and <pre>
โœ… How to display keyboard buttons with <kbd>
โœ… How to use subscript and superscript
โœ… Built a complete book review page

Common Mistakes

โŒ Not giving credit for quotes
โŒ Forgetting HTML entities when displaying code
โŒ Using <code> without <pre> for multi-line code
โŒ Not using <cite> for sources

Practice Challenge ๐Ÿ’ช

Create a page about your favorite scientist that includes:

  • Their name in a heading
  • A famous quote in a blockquote with citation
  • Birth/death dates with superscript for years
  • Their most famous equation or formula
  • A code example showing how to format their name in HTML
  • Copyright symbol in the footer

Get the Source Code

You can find all the code from this tutorial on GitHub:

๐Ÿ‘‰ Codeboid/html-series

Download the complete sale page example and practice files!

Final Thoughts

You’ve mastered professional text formatting! ๐ŸŽ‰

These skills are used on:

  • Documentation sites
  • Tutorial blogs
  • Book review sites
  • Technical articles
  • Professional portfolios

Practice by creating different types of content: reviews, tutorials, research papers, technical docs.

Youโ€™re not just learning HTML anymore.

Youโ€™re learning how to write like a real developer ๐Ÿ’ช

And trust me โ€”
These small tags are used on every professional website.

Keep going. Youโ€™re doing amazing ๐Ÿš€

Whatโ€™s Next?

Coming Up in Tutorial #3: HTML Lists

You’ll learn:

  • Unordered lists (bullet points)
  • Ordered lists (numbered)
  • Nested lists
  • Definition lists
  • Mini project: “My Goals” page

๐Ÿ‘‰ Continue to Tutorial #3 โ†’

Scroll to Top