dir
Baseline 2023
Newly available
Since January 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
语法
html
<!-- 摩洛哥风格 -->
<math dir="ltr">
<msqrt>
<mi>س</mi>
</msqrt>
<mo>=</mo>
<msup>
<mn>3</mn>
<mi>ب</mi>
</msup>
</math>
<!-- 马格里布/马什里克风格 -->
<math dir="rtl">
<msqrt>
<mi>س</mi>
</msqrt>
<mo>=</mo>
<msup>
<mn>٣</mn>
<mi>ب</mi>
</msup>
</math>
值
ltr
,表示从左到右,用于将数学表达式从左到右渲染(例如,英语或摩洛哥风格);rtl
,表示从右到左,用于将数学表达式从右到左渲染(例如,摩洛哥或马什里克风格);
规范
Specification |
---|
MathML Core # dfn-dir |
浏览器兼容性
BCD tables only load in the browser