HTML <var> tag

Updated: 11/13/2018 by Computer Hope
HTML var tag

When writing in HTML (hypertext markup language), the <var> tag is an inline element used to designate a variable. It is useful when you are writing a page that deals with programming or mathematical expressions. The following sections contain information about this tag, including an example of it in use, and related attributes and browser compatibility.

Note

This element is unique in that it is a phrase tag, which indicates that a section of text has structural meaning.

Example of <var> code

<p>Example of a regular sentence with a <var>variable</var> contained in it.</p>

Example result

Example of a regular sentence with a variable contained in it.

Attributes

All HTML tags support standard attributes that define the settings of an HTML element. Unlike other HTML tags, the <var> tag has no unique attributes.

Compatibility

Edge Internet Explorer Firefox Safari Opera Chrome
All versions All versions All versions All version All versions All versions

Additional phrase tags

Browser, Code, Compatibility, Container tag, Programming, Web design terms