Results 1 to 2 of 2

Thread: IE background fix for HTML not PHP

  1. #1
    scottie5689 is offline New Member: Posts Will Be Moderated
    Join Date
    Apr 2011
    Posts
    2

    IE background fix for HTML not PHP

    I am developing a website where my background need to stretch to the fit all windows no matter size or browser. I originally started with CSS3 background-size property. It worked fine but not in IE. I found the IE fix,

    <style type="text/css">
    html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    }
    </style>


    <img src="bgimage.jpg" alt="background image" id="bg" />
    </body>

    mg#bg {
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    }


    This worked fine when placed in a html page. However, when the image is placed into a PHP page and linked to the CSS it does not work. I get a broken image link box but no image. I have tried it now with png and gif image types. I know HTML and CSS well, not so much PHP.

  2. #2
    Join Date
    Feb 2006
    Location
    Salisbury UK
    Posts
    4,332
    I use more or less the same position: fixed code with PHP and it does work. It could be the path from the css file which is different in your PHP page.
    http://www.wickham43.net/backgroundf...hflexible.html
    However, you don't need the html, body {height: 100%;} unless there is something else that you need it for.
    Code downloaded to my PC will be deleted in due course.
    WIN7; IE9, Firefox, Opera, Chrome and Safari for Windows; screen resolution usually 1366*768.
    Also IE6 on W98 with 800*600 and IE8 on Vista 1440*900.

Similar Threads

  1. help with html code and background image for company software
    By dione0222 in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 20 Apr 2011, 01:08 AM
  2. Creating A HTML Page, Getting Parse Errors dont know how to fix it
    By dcshoeco1 in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 29 Sep 2006, 12:34 AM

Posting Permissions

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