Ryan
Ryan

Reputation: 5546

align images to right in a div

i have something like:

<div id="read_more_right">
    <a href="1"><img src='1'></a>
    <a href="1"><img src='1'></a>
    <a href="1"><img src='1'></a>
</div>

i want to align all those images to the right in a div

I use this

#read_more_right div
{
  align: right;
}

but it doesn't work. How can I allign this to the right?

Upvotes: 4

Views: 58268

Answers (7)

Agustin Meriles
Agustin Meriles

Reputation: 4854

I'm not really sure, but I think your syntax is wrong. Try this; it worked for me:

div#read_more_right 
{ 
text-align: right; 
}

Upvotes: 1

saritonin
saritonin

Reputation: 247

See also: What is the best way to left align and right align two div tags? for some answers to a similar problem and this for a good overview of float and alignment properties.

Upvotes: 0

Galled
Galled

Reputation: 4206

You could use:

#read_more_right a{
    float:right;
    clear:right;
}

http://jsfiddle.net/pE47J/

Upvotes: 8

vitaminjeff
vitaminjeff

Reputation: 608

If you're trying to select your div based on ID you need to declare it in the following fashion:

div#read_more_right { text-align: right; }

Upvotes: 2

Sam Axe
Sam Axe

Reputation: 33738

try text-align: right;

I know its not text.. but that's the one you want.

Upvotes: 0

Tom
Tom

Reputation: 22841

Try text-align: right; -- you may need to set an explicit width on the div in some cases.

Upvotes: 1

NCode
NCode

Reputation: 2808

It's text-align: right; instead of only align

Upvotes: 11

Related Questions