©
This document uses PHP Chinese website manual Release
<var> 标签表示变量的名称,或者由用户提供的值。
内容类别 | Flow content, phrasing content, palpable content. |
---|---|
允许的内容 | Phrasing content |
标记遗漏 | 开始和结束标签都是必需的 |
允许的父母 | 任何接受短语内容的元素。 |
允许ARIA角色 | 任何 |
DOM接口 | HTMLElement |
这个元素只包含全局属性。
var { font-style: italic; }
<p> A simple equation: <var>x</var> = <var>y</var> + 2 </p>
A simple equation: x = y + 2
Specification | Status | Comment |
---|---|---|
HTML Living StandardThe definition of '<var>' in that specification. | Living Standard | |
HTML5The definition of '<code>' in that specification. | Recommendation |
Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic Support | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
Feature | Android | Chrome for Android | Edge mobile | Firefox for Android | IE mobile | Opera Android | iOS Safari |
---|---|---|---|---|---|---|---|
Basic Support | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |