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)

2 answers

o.k.w 2355
This was chosen as the best answer

text-direction and align="right" are different style properties. If you want the deprecated align=right to right-align your <div> content, then use style='text-align: right;' will do.

Answered over 9 years ago by o.k.w
  • Hmm but its not text I want to align but an image or input field? Any further suggestions? Eddie over 9 years ago
  • Yes, it can be use align inline elements too, text, images and form elements inlcuded. o.k.w over 9 years ago
  • okay, text-align right seems to work, even for input fields had read that it wouldnt work. sorry Eddie over 9 years ago

Why cannot you use simple text-align:right ?

Answered over 9 years ago by Divya Manian
  • As far as I know text-align:right is just for text, not for images and input fields. But if it is please tell me. Eddie over 9 years ago