Grow your CSS skills. Land your dream job.

Background picture problems in IE8

  • # March 23, 2013 at 5:33 pm

    Hello everyone.

    I have coped with a very interesting problem:

    I have created a page with a full sized background image (taken from http://css-tricks.com/perfect-full-page-background-image/ (CSS-only Technique #1)). The stuff doesn’t work properly in IE8 when I load text dynamically via PHP script.

    For example the code:



    <!DOCTYPE html>
    <html>
    <head>
    <?php
    include_once 'lang_analyzer.php';
    ?>
    </head>
    <body>
    <img src="/images/bg.jpg" class="bg" />
    ...other stuff...
    </body>
    </html>

    shows in IE firstly the image and under the image other content. What is not correct background behaviour :). Well, after some time
    I have found a solution for that. I put lang analyser at first, like so:



    <?php
    include_once 'lang_analyzer.php';
    ?>
    <!DOCTYPE html>
    <html>
    <head> </head>
    <body>
    <img src="/images/bg.jpg" class="bg" />
    ...other stuff...
    </body>
    </html>

    ..and everything works correct, but only with an english language. When I load dynamically other languages, the letters become unreadable.

    PS: lang_analyzer.php is just a common php multilang support technique, was taken from
    http://www.bitrepository.com/php-how-to-add-multi-language-support-to-a-website.html

    PPS: style for image bg class is the same as in the example (http://css-tricks.com/perfect-full-page-background-image/ (CSS-only Technique #1))



    img.bg {
    min-height: 100%;
    min-width: 1024px;

    width: 100%;
    height: auto;

    position: fixed;
    top: 0;
    left: 0;
    }

    I would really appreciate any help :) Thank you in advance

    # March 23, 2013 at 5:39 pm

    :)

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".