Open In App

HTML <q> Tag

The <q> tag is a standard quotation tag and is used for short quotations. 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 an end tag.

Syntax: 



<q> Contents... </q>

Attributes: 

cite: It contains the value i.e URL which specifies the source URL of the Quote.



Example 1: The below example illustrates the <q> tag in 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): The below example illustrates the <q> tag in 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: 


Article Tags :