HTML <var> Tag

Topic: HTML5 Tags Reference« Prev|Next »

Description

The <var> (short for variable) tag is used to indicate that the text is an instance of a variable or program argument.

The following table summarizes the usages context and the version history of this tag.

Placement: Inline
Content: Inline and text
Start/End Tag: Start tag: required, End tag: required
Version: HTML 2, 3.2, 4, 4.01, 5

Syntax

The basic syntax of the <var> tag is given with:

HTML / XHTML: <var> ... </var>

The example below shows the <var> tag in action.

  • <p>A simple equation: <var>x</var> = <var>y</var> + 2 </p>

Tag-Specific Attributes

The <var> tag doesn't have any specific attribute.


Global Attributes

Like all other HTML tags, the <var> tag supports the global attributes in HTML5.


Event Attributes

The <var> tag also supports the event attributes in HTML5.


Browser Compatibility

The <var> tag is supported in all major modern browsers.

Browsers Icon

Basic Support—

  • Firefox 1+
  • Google Chrome 1+
  • Internet Explorer 2+
  • Apple Safari 1+
  • Opera 4+

Further Reading

See tutorial on: HTML Text Formatting.

Related tags: <code>, <kbd>, <pre>.

 
Close

Your Feedback:

 

We would love to hear from you! Please say something.