HTML <q> Tag

HTMLWeb DevelopmentFront End Technology

The q tag in HTML is used to specify a short quotation. The quotation marks get inserted around the text set inside the q tag i.e. the quotation.

Following is the attribute −

  • cite: It sets the source url of the quote.

Let us now see an example to implement the <q> tag −

Example

 Live Demo

<!DOCTYPE html>
<html>
<body>
<h2>Thoughts</h2>
   <p>Warren Buffett quoted,
   <q>It's better to hang out with people better than you. Pick out associates whose behavior is
   better than yours and you'll drift in that direction. </q></p>
   <p>Bill Gates quoted,
   <q>Your most unhappy customers are your greatest source of learning.</q></p>
</body>
</html>

Output

In the above example, we have set some quotes using the <q> tag in HTML −

<p>Warren Buffett quoted,
<q>It's better to hang out with people better than you. Pick out associates whose behavior is better than yours and you'll drift in that direction. </q>

As you can see above, we have set the quote using the <q> tag. The output displays the <q> tag automatically adds a short quotation around the quotes.

raja
Published on 19-Jun-2019 08:39:09
Advertisements