mozilla

Revision 1904 of <var>

  • Revision slug: HTML/Element/var
  • Revision title: var
  • Revision id: 1904
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment 31 words added, 1 words removed

Revision Content

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

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.

Attributes

Common attributes only.

Typical default style properties

var {
  font-style: italic; 
}

Example

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

A simple equation: x = y + 2

Specification

{{ HTML:Element_Navigation() }}

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

Revision Source

<p>The HTML Variable Element (<code>&lt;var&gt;</code>) represents a variable in a mathematical expression or a programming context.</p>
<h3 class="editable">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>
</div>
<h3>Attributes</h3>
<p>Common attributes only.</p>
<h3>Typical default style properties</h3>
<pre>var {
  font-style: italic; 
}
</pre>
<h3>Example</h3>
<pre class="eval">&lt;p&gt; A simple equation: &lt;var&gt;x&lt;/var&gt; = &lt;var&gt;y&lt;/var&gt; + 2 &lt;/p&gt;
</pre>
<p>A simple equation: <var>x</var> = <var>y</var> + 2</p>
<h3>Specification</h3>
<ul> <li><a class=" external" href="http://www.w3.org/TR/html401/struct/text.html#edef-VAR">HTML 4.01 var</a></li> <li><a class=" external" href="http://dev.w3.org/html5/markup/var.html">HTML5 var</a></li>
</ul>
<p>{{ HTML:Element_Navigation() }}</p>
<p>{{ languages( { "de": "de/HTML/Element/var" } ) }}</p>
Revert to this revision