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 about 7 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 about 7 years ago
  • Yes, it can be use align inline elements too, text, images and form elements inlcuded. o.k.w about 7 years ago
  • okay, text-align right seems to work, even for input fields had read that it wouldnt work. sorry Eddie about 7 years ago

Why cannot you use simple text-align:right ?

Answered about 7 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 about 7 years ago