Skip to content
Related Articles

Related Articles

HTML <q> Tag

View Discussion
Improve Article
Save Article
Like Article
  • Difficulty Level : Basic
  • Last Updated : 17 Mar, 2022

The <q> tag is a standard quotation tag and used for short quotation. The browser normally inserts a quotation mark around the quotation. For longer quotations, the <blockquote> tag must be used since it is a block-level element. The <q> tag requires a starting as well as end tag.
Syntax: 
 

<q> Contents... </q>

Attributes 

cite: It contains the value i.e URL which specify the source URL of the Quote.
Below examples illustrate the <q> tag in HTML:
Example 1: 
 

HTML




<html>
    <body>
         
 
<p>
          <!-- html q tag is used here -->
          <q>GeeksforGeeks</q>
            A computer science portal for geeks
        </p>
 
 
    </body>
</html>                   

Output: 
 

Example 2(Use CSS in q tag): 
 

HTML




<html>
    <head>
        <title>q tag</title>
        <style>
            q {
                color: #00cc00;
                font-style: italic;
            }
        </style>
    </head>
    <body>
     
 
<p>
      <!-- html q tag is used here -->
      <q>GeeksforGeeks</q>
    A computer science portal for geeks
    </p>
 
  
    </body>
</html>

Output: 
 

Supported Browsers: 
 

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

 


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!