How to Add Quotes in HTML?

Hello Coders, In this blog post, you will learn to add quotes in HTML. We will add quotes using q and blockquote tags in Html. Quotes are used to highlight some specific words or text blocks in the html. Let us learn both tags separately in detail:-

Quotes

Ways to add Quotes:-

q tag

The q tag is used to set the text in quotation marks. This tag is usually used for shorter text. It has both Opening <q> and Closing </q> tags. The code for q tag is as follows:-

<html>
    <head>
        <title> Quotes HTML </title>
    </head>
    <body>
        <h1> Codeblockx </h1>
        <h2> According to
            <q> CodeBlockx </q>
            , ” Coding is Easy If you are Consistent. “
        </h2>
    </body>
</html>

OUTPUT

Blockquote Tag

The blockquote tag is used to put sections in quotes text. Instead of putting text in quotes, it puts a large space at the start of the text. It is mostly used for Long text or paragraphs. It has both opening <blockquote> and closing </blockquote> tags. The code for this is as follows:-

<html>
    <head>
        <title> Quotes </title>
    </head>
    <body>
        <h1> Codeblockx </h1>
        <blockquote>
            <h3> This is a longer quote that spans multiple paragraphs. It should be indented and stand out from the rest of the text. </h3>
        </blockquote>          
    </body>
</html>
 

OUTPUT

blockQuote in html

Hope this Blog was helpful to you and you have got the answer to your question. Thank you for visiting our blog. If you have any doubts about the coding questions then let us know in the comments section we will answer them as soon as possible. Till then explore some more question in html.

Leave a Comment

Your email address will not be published. Required fields are marked *