Results 1 to 3 of 3

Thread: Is There Any Reason To Include Both Width / Height In HTML Code?

  1. #1
    You do realize by 'gay' I mean a man who has sex with other men?
    Join Date
    Oct 2003
    Location
    New Orleans, Louisiana.
    Posts
    21,635

    Is There Any Reason To Include Both Width / Height In HTML Code?

    Are both of these HTML attributes needed for image or, if i just put in the height attribute is that going to cause issues for some surfers?

    The reason im asking is that i have a whole heap of images that have a height of 1024 but the widths all vary greatly, if i cant have a set height and width, is simply adding the height actually going to do anything or should i leave that out in addition to the width?

    Im guessing its not really going to make much of a difference but i could be wrong so was hoping some of you folks could offer some advice, is something better than nothing when it comes to image dimensions in HTML code?

    Regards,

    Lee


  2. #2
    Life is a dick and when itīs get hard---just fuck it... DEVELISH's Avatar
    Join Date
    Jul 2005
    Posts
    2,367
    build the site with just one size attribute and test it with http://www.browsershots.org

    in some browsers I think I saw that when you just use one size attribute it scales the image accordingly... but I don't remember well


    dev
    :-D


  3. #3
    Gay Marriage - It's our Pearl Harbor.
    Join Date
    Dec 2008
    Location
    Buenos Aires, Argentina
    Posts
    64
    Include both, even if it makes more work for you. It makes for happier porn-buying surfers. By including image measurements, height and width, the browser can "pre-allocate" the spatial needs for the picture and display the rest of the page's content before the image finishes downloading. Otherwise, the browser has no idea how big the pic is until it gets the whole thing so it can't render the page properly...leaving a partially-formed unnavigable page. Then the surfer gets impatient and clicks to go somewhere else.

    Kevin


Posting Permissions

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