开发者

Aligning entire contents of a div to the right side using css. (i.e. align object, image or input field)

OK, DUE TO BEING NEW I WASNT ALLOWED TO POST IMAGES, SO I HAVE ATTACHED LINKS INSTEAD. (images should be inline with this question)

Im writing a webpage and have a div containing some text (inline) an then an image. Now when one clicks on the image, a hidden div appears below with an input field. The input field in this div is automatically aligned to the left edge of the div. I want it aligned to the right of the div.

As pictures speak louder than words, see link below.

http://www.freeimagehosting.net/uploads/d827ecc330.png

Anyhow the closest I got to a solution was to apply direction: rtl to hidden div, but then my text in my input field also changes to rtl.

I just want the placing of the text field to be rtl, not the开发者_C百科 input.

I hope this isnt too confusing.

Im quite new to css but have searched arund a lot, and have yet to find a solution besides the depreciated align=right.

Any suggestions greatly appreciated.


<div id="container" style="width:500px;">
  <div id="text" style="width:250px; float:left;">Text</div>
  <div id="image" style="width:250px; float:left;">Image</div>
  <div id="input" style="width:500px; float:left; text-align:right">Input</div>
</div>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜