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
    New to the CF scene
    Join Date
    Nov 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer Resize Background Image

    Is there a way to have the image of the background resize to the size of the window?

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,854
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    There is no reliable method in CSS as of now, however you could fake it by applying z-index on a normal img element. see http://webdesign.about.com/od/css3/f/blfaqbgsize.htm
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,700
    Thanks
    0
    Thanked 233 Times in 228 Posts
    Hi there Bradj47,

    and a warm welcome to these forums.
    Further to what our friend abduraooft has said..
    ...has been adopted by Opera, Safari and Konqueror browsers.
    I would hazard a guess that Firefox won't be far behind and IE well....don't hold your breath.
    Here is an example for you to try in the above mentioned browsers..
    Code:
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="Content-Style-Type" content="text/css">
    
    <style type="text/css">
    html,body {
        margin:0;
        padding:0;
        height:100%;
        background-image:url(http://www.coothead.co.uk/images/blood.jpg);
        -o-background-size:100% 100%;             /*  Opera  */
        -webkit-background-size:100% 100%;        /*  Safari  */
        -khtml-background-size:100% 100%;         /*  Konqueror  */
        background-repeat:no-repeat;
        background-attachment:fixed;
     }
    </style>
    
    </head>
    <body>
    
    <div></div>
    
    </body>
    </html>
    
    coothead


  •  

    Posting Permissions

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