Whats the difference

Discussion in 'HTML & Website Design' started by oo7ml, Aug 8, 2007.

  1. #1
    What is the difference (see height) between

    A
    <td height="37"><img src="images/next.jpg"></td>
    HTML:
    and

    B
    <td><img src="images/next.jpg" height="37"></td>
    HTML:
     
    oo7ml, Aug 8, 2007 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    One sets the height of the table cell the other defines the height of the image.

    Depending on the browser but if the image is bigger than 37px high then in A the cell will enlarge to compensate and allow the full image to be shown where as B will compress the image

    If the image was smaller than 37px then A would have no impact other than to set the cell size and the image would be at normal size within it where as B would stretch the image to 37px high
     
    AstarothSolutions, Aug 8, 2007 IP
  3. twistedspikes

    twistedspikes Notable Member

    Messages:
    5,694
    Likes Received:
    293
    Best Answers:
    0
    Trophy Points:
    280
    #3
    Exactly what the guy above me said.

    I'd try to always use images that are the correct size for where you want them though. If it's bigger than the 37px then it'll take longer to load. If it's smaller you will loose image quality resizing it.
     
    twistedspikes, Aug 8, 2007 IP