我們的志工尚未將本文翻譯為 正體中文 (繁體) 版本。加入我們,幫忙翻譯!
您也可以閱讀本文的 English (US) 版本。

The HTML <var> element represents a variable in a mathematical expression or a programming context.

Content categories Flow content, phrasing content, palpable content.
Permitted content Phrasing content
Tag omission Both start and end tags are required
Permitted parents Any element that accepts phrasing content.
Permitted ARIA roles Any
DOM Interface HTMLElement

Attributes

This element only includes the global attributes.

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

Specifications

Specification Status Comment
HTML Living Standard
The definition of '<var>' in that specification.
Living Standard  
HTML5
The definition of '<code>' in that specification.
Recommendation  

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support Yes Yes1 Yes Yes Yes
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidIE mobileOpera AndroidiOS Safari
Basic support Yes Yes Yes4 Yes Yes Yes

文件標籤與貢獻者

 最近更新: teoli,