English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML reference manual

HTML tag大全

HTML: <var> tag

The <var> tag represents the name of a variable or a value provided by the user.

Online example

Using var in mathematical equations demonstrated:

!doctype html
<html>
<head>
<meta charset="UTF-8">
<title>HTML var tag usage (Basic Tutorial Website oldtoolbag.com)</title>
</head>
<body>
<p> A simple equation: <var>x</var> = <var>y</var> + 2 </p>
</body>
</html>
Test and see ‹/›
A simple equation: x = y + 2

Browser compatibility

IEFirefoxOperaChromeSafari

All mainstream browsers support the <var> tag

Tag Definition and Usage Description

The <var> tag is a phrase tag used to define variables.

Tip: We are not against using this tag, but if you use it only to achieve a certain visual effect, we recommend using CSS, which may produce richer effects.

All Phrase Tags:

TagDescription
<em>Presented as emphasized text.
<strong>Define important text.
<dfn>Define a definition item.
<code>Define computer code text.
<samp>Define sample text.
<kbd>Define keyboard text. It indicates that the text is typed from the keyboard. It is often used in documents or manuals related to computers.
<var>Define Variables. You can use this tag in conjunction with <pre> and <code> tags.

HTML 4.01 and HTML5Differences Between

None.

Global Attributes

Support for <var> tag Global Attributes of HTML.

Event Attributes

Support for <var> tag HTML Event Attributes.

Related Articles

HTML Tutorial:HTML Text Formatting