HTML Encyclopaedia

The var tag

The HTML element
<var> text </var>

Is used for variable references within programs etc. The meaning is unclear from the HTML standards and the tag is rarely used. It seems to render text (in a monopitch typeface) as entered but line layout is not honoured. HTML special characters have to be escaped.

Here is an example

1==1 1<=2 1>=0

Here is the HTML for the example above

<var>
1==1
1&lt;=2
1&gt;=0
</var>
Notice that this is not the same as pre-formatted text.

It can also be used within running text thus: a sample of text.


See also <code>, <dfn>, <kbd>, <samp> and <cite>

Note On many browsers this tag and the others mentioned immediately above, all have exactly the same effect. Differences are purely historical.