Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2003
    Location
    Ontario, Canada
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Aligning an image in the middle of a div

    I have a DIV that is a placeholder for various images (dynamically inserted based on page view). The problem is, some of the images are a different size, so I'd like to have the image completely centered (vertically and horizontally in the DIV). How would I go about doing this?

    The DIV is always the same size, and it's dimensions are set in the stylesheet for my page...

    Code:
    <style>
        #ImageHolder {position: aboslute; .......... width: 277; height: 500;}
    </style>
    
    <div id="ImageHolder">
        <img src="IMAGEHERE">
    </div>
    IC

  • #2
    New Coder
    Join Date
    Aug 2004
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts


  •  

    Posting Permissions

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