Question

I am trying to aligning contents of a div to right edge, but I'm getting 'direction: rtl' effect (right to left), without specifying the width of the div? while keeping text direction in input fields going ltr (left to right). Is it possible?

Applying direction: right to div almost acheives effect, except text fields inputs also become rtl. (I guess align: right also works, but is depreciated)

Was it helpful?

Solution

<div style="direction: rtl;">
    Text is right-aligned
    <input type="text" value="Some value" style="direction: ltr;" />
</div>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top