HTML Tag Reference - HTML tag <q>








This element causes text to be marked by the browser as a quotation. The <blockquote> element is more appropriate for long quotations.

The <q> denotes content quoted from another source. The cite attribute is used to specify the URL of the source document.

Browser compatibility

<q> Yes Yes Yes Yes Yes

What's new in HTML5

None.





Attribute

Attribute Value Description
cite URL Specifies the source URL of the quote

Global Attributes

The <q> tag supports the Global Attributes in HTML.

Event Attributes

The <q> tag supports the Event Attributes in HTML.

Default CSS Settings

q {
display: inline; }
q:before {
content: open-quote; }
q:after {
content: close-quote; }




Example

A demo showing how to use <q> tag.

<!DOCTYPE HTML> 
<html> 
    <head> 
        <title>Example</title> 
    </head> 
<body> 
   <q cite="http://en.wikipedia.org/wiki/United_States">
   The <dfn title="USA">USA</dfn> 
   is a federal constitutional republic 
   comprising fifty states and a federal district.</q>
</p> <!--from  ww  w. j av  a2 s . c  o  m-->
</body> 
</html>

Click to view the demo