How to display a short quotation in HTML?


In Html, in order to insert quoted text in browser page, we use quotation element. The quoted text appears different when compared to normal text.

What is <q> element?

This element is used to insert quotation marks to the set of text in HTML document. It has opening and closing tag. Following is the syntax of <q> element in HTML.

<q> text…… </q>

Example

Following is an example using which we are trying to display a short quotation in HTML –

<!DOCTYPE html>
<html>
<head>
   <title>Usage of Quotations</title>
	<style>
      h1{
         color: blue;
      }
      p{
         color: red;
      }
	</style>
</head>
<body>
   <h1>TutorialsPoint</h3>
   <h2>Tutorials Point is a leading Ed Tech company <br></h2>
   <p><q>Provides best learning material on technical and non-technical subjects.</q></p>
 </body>
</html>  

The <blockquote> element

This element is used to indent the start of new paragraph and also it adds space before starting of each sentence. It has open and close tags. Following is the syntax of blockquote −

<blockquote> text……. </blockquote>

Example

In the following example we are trying to create a blockquote.

<!DOCTYPE html>
<html>
<head>
   <title>Block Quotations</title>
   <style>
      h1 {
         color: blue;
      }

      blockquote {
         color: red;
      }
   </style>
</head>
<body>
   <h1>TutorialsPoint </h1>
   <h2> Tutorials Point is a leading Ed Tech company <br>
   </h2>
   <blockquote>Provides best learning material on technical and non-technical subjects. </blockquote>
</body>
</html>

The <address> element

This element is used to define address in web page, the text that appear in between address tag is in italic format. It is useful for user to read and differentiate.

Example

Following example of the <address> tag in HTML -

<!DOCTYPE html>
<html>
<head>
   <title>Address Quotations</title>
   <style>
      h1 {
         color: blue;
      }

      address {
         color: red;
      }
   </style>
</head>
<body>
   <h1>TutorialsPoint</h1>
   <h2> Tutorials Point is a leading Ed Tech company <br>
   </h2>
   <p>Address: <br>
   <address> Tutorials Point India Private Limited, 4th Floor Incor9 Building, Kavuri Hills, Madhapur, Hyderabad, Telangana - 500081, INDIA </p>
   </address>
</body>
</html>

The <abbr> element

This element shows the abbreviation whenever you hover the mouse over the <abbr> element. It is mainly useful for search engines. Following is the syntax of abbreviation tag in HTML -

<abbr> text….. </abbr>

Example

Following example demonstrates the usage of <abbreviation> tag in HTML -

<!DOCTYPE html>
<html>
<head>
   <title>Abbreviation Quotations</title>
   <style>
      h1 {
         color: blue;
      }

      address {
         color: red;
      }
   </style>
</head>
<body>
   <h1>TutorialsPoint</h1>
   <h2> Tutorials Point is a leading Ed Tech company <br>
   </h2>
   <p>Hyper Text MarkUp Language in simple called as <br>
      <abbr title="Hyper Text Markup Language">HTML</abbr>
   </p>
</body>
</html>

Updated on: 10-Oct-2023

241 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements