Image size code help needed

Discussion in 'HTML & Website Design' started by fotoviva, Jun 23, 2007.

  1. #1
    Hi

    Please take a look at one of my category pages and see if you can work out a way to keep the portrait images the same height as the landscape ones. Currently they are generated via the database from the 500px versions which open when you click for a larger view.

    As it stands it looks awkward with big gaps in due to the portrait heights. This is the code used so far:

    
    <td colspan="2"><a class="view" href="http://www.fotoviva.co.uk/link.asp?StockNo=<%= StockNo%>"><img src="PhotosStock/<%= Image1%>" alt="<%= Title%>" width="180" border="0"></a></td>
    HTML:
    I would like the frames to be the same height and width with the images centred within them, though not distorted. Clearly this will make the portrait ones smaller but this is better than having huge gaps in the rows.

    I'm not sure if this is possible but any ideas would be appreciated.
     
    fotoviva, Jun 23, 2007 IP
  2. it career

    it career Notable Member

    Messages:
    3,562
    Likes Received:
    155
    Best Answers:
    0
    Trophy Points:
    270
    #2
    use height and width attribute of the image or rather get correct sized images.
     
    it career, Jun 23, 2007 IP
  3. fotoviva

    fotoviva Active Member

    Messages:
    265
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Thanks but these are generated from the 500px size versions and so I cannot hardcode the height and width in for each one. I have to use the code I specified in the first post to generate all the images regardless of their orientation if that is possible.

    Anyone else?
     
    fotoviva, Jun 24, 2007 IP