4 ms·
dir is a global attribute that can be set on any HTML element: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir https://developer.mozill
by divbzero 3y ago
dir is a global attribute that can be set on any HTML element:
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir https://developer.mozilla.org/en-US/docs/Web/HTML/Global_att...
What I don’t understand is why dir="auto" isn’t set as the default value, allowing browsers to choose text direction based on the lang attribute or the text content.
- jonny_eh 3y agoProbably to not break existing sites.
- donatj 3y agoIt affects float direction. Imagine the browser detecting Arabic text and suddenly all your float lefts are floating right. Switching it from one side to the other will completely break a lot of layouts, particularly older ones.
- marcosdumay 3y agoGood thing that there is no reason anymore to use float to hack page styles, instead of floating objects within your text. So that switching the direction is the correct thing to do with reasonably placed float out there.
- deleted 3y ago[deleted]