HTML Tutorial

Quotations in HTML

Quotations and quoted text can be shown in HTML using unique elements to ensure proper formatting and distinguishability.

 

1. Blockquotes:

Use the ‘<blockquote>’ tag for lengthy quotes separated from the rest of the content. This tag indents the text and frequently adds extra space above and below it, distinguishing it as a separate block.It is commonly used for quoting from other sources or long passages.

Example:

				
					<blockquote> "To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment." <footer>– Ralph Waldo Emerson</footer> <blockquote>
				
			

In this example, the `<blockquote>` tag is used to display a quote, and the `<footer>` tag adds the author’s name at the end of the quote.

 

2. Inline Quotes:

To incorporate shorter quotations into a paragraph, use the ‘<q>’ tag. This tag will add the prose message with all the content that you want in between quotation automatically.

Example:

				
					<p>Albert Einstein said that imagination is more vital than knowledge.</q></p>
				
			

The ‘<q>’ element inserts quotation marks to a brief quote within a paragraph, as shown in this example.

 



Using these tags allows you to properly format and display quotations on your website, making them visually appealing and easy to read.

Try It Yourself