<blockquote>
The <blockquote>
tag is used to define a quotation or an excerpt of text from another source. It allows you to highlight passages from other documents or another person.
It is often used to display long quotations or important excerpts, while preserving formatting and indentation to make them easily identifiable. 😉
Structure and syntax of the <blockquote>
tag
Basic structure and syntax
The <blockquote>
tag is a container tag that consists of:
- An opening tag:
<blockquote>
; - A closing tag:
</blockquote>
.
It is used to enclose a quotation or an excerpt of text. Generally, it is accompanied by a cite
attribute to specify the source of the quotation (optional, but recommended).
Usage example
Here is a practical example:
<blockquote cite="https://www.example.com">
Technology is a precious asset, as it improves our daily lives.
</blockquote>
In this example, the text within the <blockquote>
tag is a quotation, and the cite
attribute references the URL of the source.
Attributes
The <blockquote>
tag primarily accepts the cite
attribute, which allows you to specify the source of the quotation.
This attribute is optional but highly recommended.
It is of course possible to use more classic attributes like style
, class
, etc.
Difference with other similar tags
<q>
: The<q>
tag is used for inline (shorter) quotations, whereas<blockquote>
is intended for longer quotations, often accompanied by specific formatting.<cite>
: The<cite>
tag is used to specify the source of a quotation, but it is not a container like<blockquote>
.
Browser compatibility
The <blockquote>
tag is supported by all modern browsers.
Browser | Compatibility |
---|---|
Chrome | Yes |
Firefox | Yes |
Safari | Yes |
Edge | Yes |
Internet Explorer | Yes |