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 10 of 10
  1. #1
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts

    image dimesions necessary in body code?

    Hi, I 've tried the search engine but with no joy.

    I have inserted my logo into the body of my html pages like this below. It it necessary for other brwosers than IE6 that I also add the dimensions? I ask because in the future if I change the size of the logo, I dont want to have to redo all of about 400 pages.
    And should I use a closing tag somwhere?

    <img class="sitelogo" src="images/wslogovsm.gif">
    Thanks

  • #2
    Senior Coder
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    2,469
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you're using an editor like Dreamweaver you should be able to change tags sitewide, so that shouldn't be a problem -- I also wonder if you are going to update the site in the future, what's changing one more tag (even though, I agree, it can be a pain)?

    I don't know as much as the moderators here, but I have seen that putting dimensions in my tags for images has speeded up downloading for the layout of the pages... for larger images, it can be helpful if I use a lower res pre-loaded image.

  • #3
    New Coder
    Join Date
    Feb 2003
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts
    no it is not needed. if they're not used then the true size of the image will be used. if you use them it will make it fit but it might be distorted if it is a great dimension difference. so just crop it down before you do that.

  • #4
    Senior Coder
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    2,469
    Thanks
    0
    Thanked 0 Times in 0 Posts
    BloodXero -- so you're saying, basically, that if you post a different image size in the text then the actual image size, it will distort the graphic... that makes sense, I was just trying to understand that better - but I was aware of that.

    Then it's not needed? Cool, I'll quit doing that too then

  • #5
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    excellent news BloodXero

    I had always thought that they way to do it 'properly' was to make the image the size that it was supposed to be on the page and not to rely on dimensions in the script, to make it the desired size. But I have been made more aware of cross-browser considerations since finding you guys here and had a panic last night when I imagined that some browsers might think that my image was supposed to be the size of the window

    Still I now know I needn't wory about that bit of my script then

  • #6
    New Coder
    Join Date
    Feb 2003
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well it matters which way you like it. if you leave out the properties in the tag it will be the image size but sometimes it might be too big or small. if you put in the tag properties and the w:h ratio of the real image is a good ways away from the w:h ratio of the tag than it will be the exact right size you need but it can get severely distorted. if you dont have any good image editing program like PSP or PS7 than a little bit of distortion is ok. but if it gets out of hand and there is no possible way to make it any better i suggest you find another image or remake it. but if you put in the tag properties and they are the same as the image size nothing will happen. so if you made it to fit in perfectly you can just leave out the width and height.

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Location
    Iowa / Notre Dame
    Posts
    538
    Thanks
    0
    Thanked 0 Times in 0 Posts
    In HTML there is no ending tag for <img>, but in XHTML you need to end the <img> tag (along with all empty tags) by adding a trailing slash: <img src="blah" />.

    About specifying width and height: It is recommended that you do so if your layout depends on your image size. If you specify the width and height then even if your image cannot be found for some reason the "dead-image" box will be the size that the normal image should be. I hope you understood that as I am having a terrible time explaining this today .

    Another reason why it is nice to specify width and height is that on slower modems (i.e. 56k and lower) the images will get bigger as they load. If you have a 400x400 image it will grow from 0x400 to 400x400. Thus if you have any text on the page around the image, it is likely to jump around and be nice and annoying.

    If you are worried about changing the image tag for a bunch of pages you could look into some form of including. Using PHP or SSI you could easily include a file that had the image information in there. Then all you would have to do is change the one file with the image info in it.
    My Site {Mike's Adventures}

    Yikes, forums are almost too much fun.

  • #8
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    pardicity3 is right - not only does specifying the dimensions ensure that the bounding box is the right size even if it can't be found, it also speeds up the download and rendering process - a page will render more quickly if you specify the initial width and height of images because then it doesn't have to redraw after the images have been loaded.

    Always specify the dimensions.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #9
    New Coder
    Join Date
    Feb 2003
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ya i guess they're right. if its not important for exact layout its not needed but if you want things in one place with one size and one size only it might be a good idea to use it.

  • #10
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    So far I have my images (and the whole layout), cotrolled by an external style sheets. So the seems not to affect nay other part of the page layout. I just wondered if other browsers might not render the same way. But i'd better ask the question relative to that in the correct forum

    thanks


  •  

    Posting Permissions

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