Eden 0

Hi,,

I've a TD that contains an Image. How can I position the image at the bottom right corner (using CSS 2.1)

Thanks,

Eden

2 answers

o.k.w 2355
3
points

One methos I used in one of the posts here, which set the style's position of the container to 'relative', then set the image's to 'absolute' with right and bottom values = 0.

td.container {
  position: relative;
}
img.rightbottom{
  position: absolute;
  bottom: 0;
  right: 0;
}
Answered about 7 years ago by o.k.w
  • It seems that Firefox doesn't support "position: relative;" on <TD> (while IE does). So I had to place the content inside of a <DIV>. Seems to work. Thanks. Eden about 7 years ago
  • @Eden: I've not tried it on TD actually, now I know. Thanks too! o.k.w about 7 years ago
danwellman 5600
1
point

As it's a <td> element you should be able to use vertical-align:bottom; text-align:right on the <td>

Or you could use the align="right" attribute on the image itself if text-align doesn't work, although this isn't CSS...

If the image is a background image you should be able to use background-position:100% 100%; for it to line up in the bottom right

Answered about 7 years ago by danwellman