HTML - <var>

The HTML Variable Element (<var>) represents a variable in a mathematical expression or a programming context.

Example

 

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

A simple equation: x = y + 2

Description  

The HTML Variable Element (<var>) represents a variable in a mathematical expression or a programming context.

Permitted content Phrasing content
Tag omission Both start and end tags are required
Permitted parent elements Any element that accepts phrasing content.
Normative document HTML, "The var element"

DOM Interface

This element implements the HTMLElement interface.

Implementation Note: up to Gecko 1.9.2 inclusive, Firefox implements the HTMLSpanElement interface for this element.

Typical default style properties

CSS
var {
  font-style: italic; 
}

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/html/element/var

Element Élément HTML HTML text-level semantics Reference Référence Web