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
Chrome | Edge | Firefox | IE | Opera | Safari |
---|---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes | Yes |
Mobile
Android Webview | Chrome Android | Firefox Android | Opera Android | iOS Safari | Samsung Internet |
---|---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes | Yes |