HTML Quotations

HTML provides the below elements to handle quotations in an HTML document.

There are two types of quotations

  • Block Quotation
  • Inline Quotation

Block Quotation

HTML element <blockquote> is used to define a block quotation, usually to include a section of text that is quoted from another source.

Browsers display the block quotes with some indentation.

<blockquote>
    <p>Learn from yesterday, live for today, hope for tomorrow. The important thing is not to stop questioning.</p>
</blockquote>

Inline Quotation

HTML element <q> is used to define an inline quotation, which is displayed within double quotes.

<p>According to the World Health Organization (WHO): <q>Health is a state of complete physical, mental, and social well-being.</q></p>

Example

We can check the outcome of the below HTML document to see how it looks.

<!doctype html>
<html lang="en">
<head>
</head>
<body>
    <h1>HTML Quotations</h1>
    <hr>
    <h2>Block Quotation</h2>
    <blockquote>
        <p>Learn from yesterday, live for today, hope for tomorrow.The important thing is not to stop questioning.</p>
        <p>- Anonymous</p>
    </blockquote>
    <h2>Inline Quotation</h2>
    <p>According to the World Health Organization (WHO): <q>Health is a state of complete physical, mental, and social well-being.</q></p>
</body>
</html>

Overall

HTML Quotations are very helpful in quoting text from another source.