tags:

views:

19

answers:

4

Hello, I would like to know how to align the image inside the div on the right side?

Thank you.

+1  A: 
<style type="text/css">
>> .imgTop {
>>  display: block;
>>  text-align: right;
>>  }
>> </style>

<img class="imgTop" src="imgName.gif" alt="image description" height="100" width="100">
A: 

vertical-align:middle; text-align:right;

psychotik
A: 

You can give the surrounding div a

text-align: right

this will leave white space to the left of the image. (= the image will occupy the whole line).

If you want content to be shown to the left hand side of the image, use

float: right

on the image. However, the surrounding div will then need overflow: auto to stretch to the needed height.

Pekka
Thank you, this technique is great.
Linards
A: 
<div style="width:300px; text-align:right;">
        <img src="someimgage.gif">
</div>
gillyb