Skip to content
Related Articles

Related Articles

HTML5 MathML dir Attribute

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 16 Nov, 2020

This attributes holds the direction value. It holds two types of direction values ltr for left to right and rtl for right to left. This attribute is accepted by <math>, <mi>, <mo>, <mrow>, <ms>,  and <mtext>.


<element dir="ltr|rtl">

Attribute Values:

  • ltr: This value holds the direction from left to right.
  • rtl: This value holds the direction from right to left.

Below example illustrate the dir attribute in HTML5 MathML:



<!DOCTYPE html> 
    <title>HTML5 MathML dir attribute</title
        <h1 style="color:green"
        <h3>HTML5 MathML dir attribute</h3
        <math dir="rtl"


Supported Browsers: The browsers supported by HTML5 MathML dir attribute are listed below:

  • Firefox

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!