HTML Tutorial

HTML Tag: <blockquote>

Purpose of the <blockquote>

Tag:

The <blockquote> tag is used to highlight a section of text as a quotation or an excerpt from another source. It visually indents the quoted content and typically displays it in a different style.

Usage:

  • To create a quotation, place the quoted text within the <blockquote> tags:
<blockquote>
This is an example of a quotation.
</blockquote>
  • To indicate the source of the quotation, use the cite attribute:
<blockquote cite="https://www.example.com">
This is an example of a quotation.
</blockquote>

Attributes of the <blockquote>

Tag:

  • cite: Specifies the URL or source of the quotation.

Examples:

  • Simple quotation:
<blockquote>
"To be or not to be, that is the question."
</blockquote>
  • Quotation with a source:
<blockquote cite="https://www.shakespeare.com/hamlet">
"To be or not to be, that is the question." - Hamlet, Act III, Scene I
</blockquote>

Simple HTML Example:

<!DOCTYPE html>
<html>
<body>

<h1>HTML Code Example</h1>
<h2>Using the <blockquote> Tag</h2>

<p>Here is an example of a quotation using the <blockquote> tag:</p>

<p>
<blockquote>
  "The greatest glory in living lies not in never failing, but in rising every time we fall." - Nelson Mandela
</blockquote>
</p>

</body>
</html>

Accessibility Considerations:

  • When using the
    tag for quotations, it's important to provide the source or author information using the cite attribute. This helps users understand the context and credibility of the quoted material.
  • For screen readers, it's recommended to use the tag within the
    tag to indicate the source of the quotation.