Css: dir = "rtl" VS style = "direction: rtl"
I know how style is when direction is inline
<div dir="rtl">foo</div>
div[dir="rtl"]
{
....;
}
But style
<div style="direction:rtl">foo</div> ?
Both behave as expected (correct "alignment" of the text), but I need a more subtle change for some elements inside (float, text-align ...), and I can’t set up my rule correctly in the second case.
I can not edit html. I MUST use the style = "direction: rtl".
dir = "auto" , ,
<div dir="auto">Hello, world!</div>
<br/>
<div dir="auto">لا إله إلا الله محمد رسول الله</div>
<br/>
<input type="text" dir="auto" value="Hello, world!" >
<br/><br/>
<input type="text" dir="auto" value="لا إله إلا الله محمد رسول الله" >JSFIDDLE Demo https://jsfiddle.net/80k0drsf/