Revision 1908 of <var>

  • Revision slug: HTML/Element/var
  • Revision title: var
  • Revision id: 1908
  • Created:
  • Creator: ethertank
  • Is current revision? No
  • Comment +ja; 14 words added, 4 words removed

Revision Content


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

Usage 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"


Global attributes only.

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

var {
  font-style: italic; 


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

A simple equation: x = y + 2

{{ HTML:Element_Navigation() }}
{{ languages({ "de": "de/HTML/Element/var", "ja": "de/HTML/Element/var" }) }}

Revision Source

<h2 id="Summary">Summary</h2>
<p>The HTML Variable Element (<code>&lt;var&gt;</code>) represents a variable in a mathematical expression or a programming context.</p>
<h2 id="Usage_Context">Usage Context</h2>
<table class="standard-table"> <tbody> <tr> <td>Permitted content</td> <td>Phrasing content</td> </tr> <tr> <td>Tag omission</td> <td>Both start and end tags are required</td> </tr> <tr> <td>Permitted parent elements</td> <td>Any element that accepts <a href="/en/HTML/Content_categories#phrasing_content" title="en/HTML/Content categories#phrasing content">phrasing content</a>.</td> </tr> <tr> <td>Normative document</td> <td><a class="external" href="">HTML, "The <code>var</code> element"</a></td> </tr> </tbody>
<h2 id="Attributes">Attributes</h2>
<p>Global attributes only.</p>
<h3 class="editable" id="DOM_Interface">DOM Interface</h3>
<p>This element implements the <code><a href="/en/DOM/element" title="en/DOM/element">HTMLElement</a></code> interface.</p>
<div class="note"> <p><strong>Implementation note: </strong>up to Gecko 1.9.2 inclusive, Firefox implements the <a href="/en/DOM/span" title="en/DOM/span"><span style="font-family: Courier New;">HTMLSpanElement</span></a> interface for this element.</p>
<h3 id="Typical_default_style_properties">Typical default style properties</h3>
<pre>var {
  font-style: italic; 
<h3 id="Example">Example</h3>
<pre class="brush: html">&lt;p&gt; A simple equation: &lt;var&gt;x&lt;/var&gt; = &lt;var&gt;y&lt;/var&gt; + 2 &lt;/p&gt;
<p>A simple equation: <var>x</var> = <var>y</var> + 2</p>
<div>{{ HTML:Element_Navigation() }}</div>
<div>{{ languages({
"de": "de/HTML/Element/var",
"ja": "de/HTML/Element/var"
}) }}</div>
Revert to this revision