Baseline 2023Newly available
Since January 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
MathML 元素是顶级的 MathML 元素,用于编写单个数学公式。可以将其放在允许流式内容的 HTML 内容中。
备注: 参阅编写 MathML 页面以了解如何正确地在网页中集成 MathML 公式,有关更多的演示,请参阅示例页面。
属性
该元素的属性包括全局 MathML 属性和以下属性:
display
-
该枚举属性指定了应如何渲染封闭的 MathML 标记。其可以是以下值之一:
block
,这意味着该元素将显示在当前文本范围之外的块中,并将math-style
设置为normal
。inline
,这意味着该元素将显示在当前的文本范围内,并将math-style
设置为compact
。
如果没有指定该属性,其默认值为
inline
。
示例
该示例包含两个 MathML 公式。第一个在其自己的居中的块中渲染,根据需要占用足够的空间。第二个公式则在其文本段落中渲染,缩小其尺寸和间距以最小化其高度。
html
无穷级数
的和等于实数
。
规范
Specification |
---|
MathML Core # the-top-level-math-element |