HTML provides special tags for displaying quotations and code. These tags help present content in a clear and meaningful way.
Quotations
Quotations are used to show text that is taken from another source or to highlight spoken or written words.
HTML provides two main tags for quotations.
Blockquote Tag
The blockquote tag is used for long quotations. It displays the text in a separate block, usually with indentation.
Example of Blockquote
<blockquote> This is a long quotation used to represent a section of text taken from another source. </blockquote>
Inline Quotation
The q tag is used for short quotations within a sentence. It automatically adds quotation marks around the text.
Example of Inline Quotation
<p>He said <q>HTML is very easy to learn</q> during the class.</p>
Code Tags
Code tags are used to display programming code or technical text. They help differentiate code from normal text.
Code Tag
The code tag is used to show a small piece of code.
Example of Code Tag
<p>Use the <code>console.log()</code> function to print output.</p>
Pre Tag
The pre tag is used to display formatted code with spaces and line breaks preserved.
Example of Pre Tag
<pre> function hello() { console.log(“Hello World”); } </pre>
Summary
Quotation tags are used to display quoted text, while code tags are used to show programming code. These tags help make content more structured and easier to understand.