views:

269

answers:

1

Aligning contents of a div to right edge. 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)

+1  A: 
<div style="direction: rtl;">
    Text is right-aligned
    <input type="text" value="Some value" style="direction: ltr;" />
</div>
St.Woland
I know that but I have images and input field also.
Check the updated answer. You may use *css* to apply styles to all elements.
St.Woland
nice, but i think i tried this already and the outer rtl overrides the inner ltr. strange but true, i think.
okay, text-align right seems to work, even for input fields had read that it wouldnt work. sorry