Baseline Widely available
The dir
global attribute is an enumerated attribute that indicates the directionality of the MathML element.
html,
body {
height: 100%;
}
body {
display: grid;
place-items: center;
font-size: 1.5rem;
}
<!-- Moroccan style -->
<math display="block" dir="ltr">
<msqrt>
<mi>س</mi>
</msqrt>
<mo>=</mo>
<msup>
<mn>3</mn>
<mi>ب</mi>
</msup>
</math>
<!-- Maghreb/Machrek style -->
<math display="block" dir="rtl">
<msqrt>
<mi>س</mi>
</msqrt>
<mo>=</mo>
<msup>
<mn>Ù£</mn>
<mi>ب</mi>
</msup>
</math>
Syntax
<math dir="ltr">
<math dir="rtl">
Values
ltr
, which means left to right and is used to render mathematical expressions from the left to the right (e.g., English or Moroccan style);rtl
, which means right to left and is used to render mathematical expressions from the right to the left (e.g., Maghreb or Machrek style);Note:
direction
, if a CSS page is active and the element supports these properties.dir
attribute is used to set the directionality of math formulas, which is often from right to left in Arabic-speaking world. However, languages written from right to left often embed mathematical content written from left to right. Consequently, the auto
keyword from the HTML dir
attribute is not recognized and by default the user agent stylesheet resets the direction property on the math
element.direction
dir
global attributeRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4