SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    May 2006
    Posts
    291
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Align image to the bottom of a table cell

    Hi All

    I need to align a rectangular image to sit against the bottom of a table cell. So far, I have only worked out how to do this when it is a background image. However, I don't want it as a background image, as I don't want text to go over it.

    How do I align an image against the bottom of a table cell? So far I have tried:

    .cellimgbottom {
    position: relative;
    bottom: 0px;
    }

    but this is aligning the image relative to the text in the cell, and not to the bottom of the cell itself.

    Many thanks

    Accelerator

  2. #2
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
       .cellimgbottom {
      	position: relative;
      	bottom: 0;
      	background: url('path/to/image.jpg') bottom-left;
       }
    for a background image, and standard images (I think--I'm REALLY tired right now and am not thinking straight at the moment... please accept my apologies if I'm wrong)
    Code:
        .cellimgbottom {
       	position: relative;
       	bottom: 0;
       	right: 0;
        }
    Also note that you don't need to declare a unit (like pixels) if the value is 0. Zero is zero is zero, whether it's pixels, ems, percentages or Coke Zero.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •