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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Sep 2008
    Posts
    116
    Thanks
    2
    Thanked 0 Times in 0 Posts

    problem in background image

    i want to put a background image for a <div> element. the image I have made is longer than size of <div> element hence the image doesn't fit properly inside this element.
    In second try, I made that image little shorter than the size of <div> element and the problem is still there.

    I there any setting in <div>'s style so that the background image would be auto resized to fit properly inside it?

  • #2
    Regular Coder
    Join Date
    Apr 2005
    Posts
    114
    Thanks
    14
    Thanked 0 Times in 0 Posts
    Can you post your code or a link? the problem doesn't seem to be resizing the background image although you could set the overflow or possibly the repeat values.

  • #3
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    I there any setting in <div>'s style so that the background image would be auto resized to fit properly inside it?
    Resizing background image using CSS is possible, but it's supported in CSS3 only.
    Though you may fake it by using an absolutely positioned img tag, and some z-index, see http://www.cssplay.co.uk/layouts/background.html
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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