HTML / HTML Tags

HTML <Var> Tag

Dec 12, 2022
1 min read
HTML var Tag

Definition

The <var> element represents a variable, such as those used in mathematical expressions or programming. The element is usually displayed in italic.

Example

Energy can be defined as the <var>m</var> x <var>c</var> x <var>c</var>.

Usage

  • Both the opening and closing tags are required.
  • The <var> element can used where phrasing content is permissible.
  • The <var> element can contain phrasing content.
  • It can be used to represent the following:
    • A mathematical expression variable.
    • A programming variable.
    • An identifier representing a constant.
    • A symbol identyfying a physical quantity.
    • A function parameter.
    • A placeholder in prose.

Attributes

The <var> element only supports the Global Attributes.

Specification

Browser Support

Desktop

ChromeEdgeFirefoxIEOperaSafari
YesYesYesYesYesYes

Mobile

Android WebviewChrome AndroidFirefox AndroidOpera AndroidiOS SafariSamsung Internet
YesYesYesYesYesYes