leela52452 Posted November 11, 2019 Share Posted November 11, 2019 is it compulsory to declare dir Attribute doesn't the lang="en" is self explanatory should we use it sparingly or declare for specific purposes Link to comment Share on other sites More sharing options...
Ingolme Posted November 12, 2019 Share Posted November 12, 2019 It's optional, I don't see a reason to use it. 1 Link to comment Share on other sites More sharing options...
ishan_shah Posted December 6, 2019 Share Posted December 6, 2019 Hello @leela52452,dir attribute is used to set the direction of the text within an element in an HTML document. If you set it as an RTL then it will display HTML from right to left. It generally used when language is like Arabic etc. dir attribute is not a compulsory attribute so you can also skip this. 1 Link to comment Share on other sites More sharing options...
shaili_shah Posted December 23, 2019 Share Posted December 23, 2019 dir attribute sets the direction of the text within an element in HTML document,it is not complusory, the value of the dir attribute is either ltr (i.e. left to right) or rtl (i.e. right to left). Link to comment Share on other sites More sharing options...
ishan_shah Posted February 4, 2020 Share Posted February 4, 2020 Hello, we use dir tag to apply direction to our text for example : Add dir="rtl" to the html tag any time the overall document direction is right-to-left. This sets the base direction for the whole document. No dir attribute is needed for documents that have a base direction of left-to-right, since this is the default. <!DOCTYPE html> <html dir="rtl" lang="ar"> <head> <meta charset="utf-8"> ... Adding dir="rtl" to the html element will cause block elements and table columns to start on the right and flow from right to left. All block elements in the document will inherit this setting unless the direction is explicitly overridden. Same goes for ltr(Left to right ) {rtl(Right to Left)} Link to comment Share on other sites More sharing options...
dsonesuk Posted February 4, 2020 Share Posted February 4, 2020 From https://www.w3.org/International/geo/html-tech/tech-bidi.html Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now