HTML – Cite, Q(Quotation), Var and Samp Tags

HTML - Cite, Q(Quotation), Var and Samp Tags

HTML <cite> Element

If you are quoting a text, you can indicate the source by placing it between an opening <cite> tag and a closing </cite> tag. The content of the <cite> element is rendered in italicized text by default.  HTML Code

This HTML tutorial course will help you in <cite> Web Development Field </cite>

HTML Output

This HTML tutorial course will help you in  Web Development Field 

If you are referencing an online resources, you should use your <cite> element inside an <a> element. Mainly the <cite> used to make bibliography and etc. The <cite> element can be used in <blockquote> tag and <q> tag.

HTML <q> Element

The <q> element is intended to be used when you want to add a quote within a sentence, rather than as an indented block. HTML Code

<p> She said, <q> I ruined her life.</q></p>

HTML Output

She said,  I ruined her life.

The text enclosed in a <q> element should be begin and end in double quotes. </q> The <q> element can also carry the cite attribute. The value of the cite attribute must be the URL and pointing to the specific location of the source.

HTML <var> Element

The <var> element is used for programming variables. If there are any programming variable in webpage we can use <var> element for indicating them. It is usually used in conjunction with the <pre> and <code> elements to indicate that the content of the element is variable.

HTML Code

<p><code>document.write("<var>user-name</var>")</code></p>

HTML Output

document.write("user-name")

The content of <var> element is italicized as you can see in above html output [user-name] is italicized.

HTML <samp> Element.

The <samp> element indicate sample output from a program, script, or the like. Again, it is mainly used when documenting programming concepts.

HTML Code

<p> The following line uses the &lt;samp&gt; element to indicate the output from a script or program</p>
<p><samp> This is the output from our test script.</samp></p>

HTML Output

The following line uses the <samp> element to indicate the output from a script or program This is the output from our test script. This tends to be displayed in a monospaced font, as you can see above html output.