HTML HTML Tutorial HTML Forms HTML Graphics HTML Media HTML APIs HTML Tags



HTML Quotations

HTML quotations are used to indicate that a particular section of text has been taken from another source. This can be useful for providing context or giving credit to the original author. There are two types of HTML quotations: <q> and <blockquote>.

The <q> tag

The <q> tag is used to indicate a short quotation. This could be a single word or a few words. The <q> tag should be used when the quotation is integrated into the surrounding text. For example:

According to Forbes, the richest person in the world is currently Jeff Bezos.

In this example, the <q> tag is used to indicate that the word "Forbes" is a quotation. The <q> tag is also used to indicate that the quotation is short and integrated into the surrounding text.

The <blockquote> tag

The <blockquote> tag is used to indicate a longer quotation. This could be a paragraph or several paragraphs. The <blockquote> tag should be used when the quotation is set apart from the surrounding text. For example:

As Martin Luther King Jr. once said:

Darkness cannot drive out darkness; only light can do that. Hate cannot drive out hate; only love can do that.

In this example, the <blockquote> tag is used to indicate that the quotation is longer and set apart from the surrounding text. The <q> tag is used to indicate that the words within the quotation marks are a direct quote from Martin Luther King Jr.

Nesting quotations

It is possible to nest quotations within each other. For example:

As Albert Einstein once said:

Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world.

In this example, the <blockquote> tag is used to indicate that the entire passage is a quotation. The <q> tag is used to indicate that the words within the quotation marks are a direct quote from Albert Einstein.

Conclusion

HTML quotations are a useful way to indicate that a particular section of text has been taken from another source. The <q> tag should be used for short quotations that are integrated into the surrounding text, while the <blockquote> tag should be used for longer quotations that are set apart from the surrounding text. It is also possible to nest quotations within each other.

References

Activity