此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

<ms>

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2023年1月⁩.

<ms> MathML 元素表示要由编程语言和计算机代数系统解释的字符串字面量。

属性

此元素包括全局 MathML 属性

某些浏览器还可能支持以下已弃用属性,并将 <ms> 元素的内容用指定的开引号和闭引号包围起来:

lquote

用于包围内容的开引号。默认值为 &quot;

rquote

用于包围内容的闭引号。默认值为 &quot;

示例

默认渲染

html
<math display="block">
  <ms>Hello World!</ms>
</math>

旧版 quote 属性

html
<math display="block">
  <ms lquote="„" rquote="'">abc</ms>
</math>

规范

Specification
MathML Core
# string-literal-ms

浏览器兼容性