HTML Text Formatting for Beginners: Quotes, Code & Special Characters (Part 2)
Hey friend! ๐
Welcome back to our HTML Basics for Beginners series!
In Part 1 of HTML Text Formatting, you learned how to:
- 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
Prerequisites:
โ
Completed Tutorial #2 Part 1 (bold, italic, basic formatting)
โ
A text editor (VS Code, Notepad, etc.)
โ
A web browser (Chrome, Firefox, etc.)
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.
<p>My teacher said, <q>Practice every day.</q></p>๐ Try it on CodePen
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.
<blockquote>
Learning never exhausts the mind.
</blockquote>๐ Try it on CodePen
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>
| Tag | Use |
|---|---|
<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.
<p><cite>โ Albert Einstein</cite></p>๐ Try it on CodePen
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.
<blockquote>
Imagination is more important than knowledge.
</blockquote>
<p><cite>โ Albert Einstein</cite></p>๐ Try it on CodePen
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)
<p>As my mentor once said:</p>
<blockquote>
<p>Don't rush the process. Good things take time.</p>
</blockquote>
<p><cite>โ My Coding Mentor</cite></p>๐ Try it on CodePen
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
<p>Use the <p> tag</p>This breaks your page โ
Because <p> is treated as a real tag.
The Solution โ HTML Entities
<p>Use the <p> tag</p>๐ Output: Use the <p> tag
Common HTML Entities
| Symbol | Code | Description |
|---|---|---|
| < | < | Less than |
| > | > | Greater than |
| & | & | Ampersand |
| “ | " | Quotation mark |
| ‘ | ' | Apostrophe |
| ยฉ | © | Copyright symbol |
| ยฎ | ® | Registered trademark |
| โข | ™ | Trademark |
| โฌ | € | Euro |
| ยฃ | £ | Pound sterling |
| ยฅ | ¥ | Yen |
| (space) | | Non-breaking space |
Examples:
<p>To write HTML tags, use <p> and </p>.</p>
<p>Copyright © 2026 My Website. All rights reserved.</p>
<p>Coca-Cola® is a registered trademark.</p>
<p>Price: €49.99</p>
<p>Ben & Jerry's</p>๐ Try it on CodePen
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 ( )
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.
<p>To create a paragraph, use the <code>p</code> tag.</p>
<p>The <code>h1</code> tag creates the biggest heading.</p>
<p>In Python, use <code>print()</code> to display text.</p>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!
<p>Use the <code><strong></code> tag to make text bold and important.</p>
<p>To create a heading, use <code><h1>My Heading</h1></code>.</p>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>:
<pre>
<code>
function sayHello() {
console.log("Hello, World!");
}
</code>
</pre>See the Pen Codeboid โ HTML Tutorial #2 โ by Codeboid (@Codeboid) on CodePen.
Best Practice โ <pre> + <code>
<pre>
<code>
<h1>Hello World</h1>
<p>Learning HTML</p>
</code>
</pre>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 ๐
<p>Press <kbd>Ctrl</kbd> + <kbd>S</kbd></p>๐ Try it on CodePen
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.
<p>Water formula: H<sub>2</sub>O</p>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.
<p>2<sup>3</sup> = 8</p>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
<p>Chemical formula: CO<sub>2</sub></p>
<p>Math equation: E = mc<sup>2</sup></p>
<p>Temperature: 25ยฐC<sup>*</sup></p>
<p><small><sup>*</sup>Measured at sea level</small></p>๐ Try it on CodePen
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:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Book Review</title>
</head>
<body>
<h1>Book Review</h1>
<h2><i>To Kill a Mockingbird</i></h2>
<p><strong>Author:</strong> Harper Lee</p>
<p><strong>Rating:</strong> 5<sup>โ
โ
โ
โ
โ
</sup></p>
<p><strong>Published:</strong> July 11, 1960</p>
<hr>
<h3>My Favorite Quote</h3>
<blockquote>
<p>You never really understand a person until you consider things from his point of view.</p>
</blockquote>
<p><cite>โ Atticus Finch, To Kill a Mockingbird</cite></p>
<hr>
<h3>My Review</h3>
<p>This book is <strong>absolutely incredible</strong>. I <em>could not</em> put it down!</p>
<p>The story explores themes of racial injustice, childhood innocence, and moral growth. Harper Lee's writing style is <mark>beautiful and timeless</mark>.</p>
<p>What I loved most was the character development. Scout's journey from innocence to understanding is portrayed with <strong>authenticity and heart</strong>.</p>
<hr>
<h3>Who Should Read This?</h3>
<p>This book is perfect for:</p>
<p>
- Anyone interested in American history<br>
- Readers who love character-driven stories<br>
- People who enjoy thought-provoking literature<br>
- Students studying social justice
</p>
<hr>
<h3>Technical Details</h3>
<p><strong>Pages:</strong> 324</p>
<p><strong>Genre:</strong> Southern Gothic, Coming-of-age</p>
<hr>
<h3>Code Example: How to Format a Book Title</h3>
<p>In HTML, use the <code><i></code> tag for book titles:</p>
<pre>
<code>
<p>My favorite book is <i>To Kill a Mockingbird</i>.</p>
</code>
</pre>
<hr>
<h3>Final Verdict</h3>
<p><strong>Would I recommend this book?</strong> <em>Absolutely, yes!</em> 10/10</p>
<p>If I could describe this book in one word, it would be <mark>essential</mark>.</p>
<p><small>This review reflects my personal opinion and experience with the book.</small></p>
<hr>
<footer>
<p><small>Copyright © 2026 MyBookReviews.com | All rights reserved</small></p>
</footer>
</body>
</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
โ
< and > โ Safely display HTML tags as text
โ
© โ Copyright symbol in the footer
Your Turn! ๐ฏ
Customize this page:
- Change the book to YOUR favorite book
- Write your own honest review
- Add your favorite quote from the book
- Include a code example showing an HTML tag
- Use special characters in the footer
- Add chemistry formulas or math equations if relevant
๐ Open it in your browser and admire your work!
Cheat Sheet (Save This!)
QUOTES & CITATIONS
<q>text</q> โ Short quote
<blockquote> โ Long quote
<cite>source</cite> โ Citation
DISPLAYING CODE
<code>code</code> โ Inline code
<pre><code> โ Code block
NUMBERS & FORMULAS
<sub>2</sub> โ Subscript (HโO)
<sup>2</sup> โ Superscript (E=mcยฒ)
DISPLAY KEYBOARD BUTTONS
<kbd>ctrl+p</kbd> โ Display keyboard buttons
SPECIAL CHARACTERS
< โ < (less than)
> โ > (greater than)
& โ & (ampersand)
© โ ยฉ (copyright)
® โ ยฎ (registered)
™ โ โข (trademark)
€ โ โฌ (euro)
£ โ ยฃ (pound)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

