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 5 of 5

Thread: resize an image

  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    resize an image

    if I use a <img> tag I can resize the image with width and height but how can I resize the image if I use it as a background of <td>
    such as: <td style="background-image: url(myimage.gif);">
    USA

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    United Kingdom Confused: Often
    Posts
    859
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you cant.

    you could take a look at this page to see what CSS can do to a background though...
    redhead

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK, Thank you
    USA

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    United Kingdom Confused: Often
    Posts
    859
    Thanks
    0
    Thanked 0 Times in 0 Posts
    no problem. sorry i couldnt come up with a somewhat more productive answer you never know... someone might have discovered something i've never known.
    redhead

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,253
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Not a great idea anyway

    Landon11,

    it's not a great idea anyway to have the browser resize an image using width and/or height; if the image is reduced in size this way, it still has to be loaded in its original size, creating unnecessary download effort, and the algorithm used by the browser in question may not produce the best result. Having the browser enlarge an image does reduce download effort, but may also result in an ugly picture (there are cases in which this effect can be deliberately used, but with caution).
    Best solution is to use images with the desired size. To my knowledge, there's no way in CSS to resize an image used as background, anyway.
    Regards,
    Ronald.
    ronaldvanderwijden.com


  •  

    Posting Permissions

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