SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict
    Join Date
    Apr 2003
    Posts
    332
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    FF loses background image.

    On this site http://www.namipaeriecounty.org/index.php
    I am using an include file for the menu. I swap images for the active file and IE handles it well. However,the new image is lost in FF. What now?

    include file:

    <p class="hide"><a href="#cont">Skip Nav</a></p>

    <table summary="table of contents">

    <tr><td style="<?php if($_SERVER['PHP_SELF']=='/index.php'){echo ("background:lavender url(images/live.png) center left no-repeat fixed");}?>"><a href="index.php" title="Home Page">Home</a></td></tr>


    <tr><td style="<?php if($_SERVER['PHP_SELF']=='/about.php'){echo ("background:lavender url(images/live.png) center left no-repeat fixed");}?>"><a href="about.php" title="Read about our organization">About&nbsp;us</a></td></tr>



    </table>



    Thanks, Andy

  2. #2
    SitePoint Addict Caterwomtious's Avatar
    Join Date
    Dec 2001
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not sure. Something you could try though would be putting the styles in your CSS file, and changing the class with your PHP instead.

  3. #3
    SitePoint Addict Caterwomtious's Avatar
    Join Date
    Dec 2001
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually try getting rid of "fixed" from your style. It doesn't make any sense to use a fixed background in this case - a fixed background stays put as the page scrolls.

    If the fixed background is at fault, it would explain the IE/FF difference. Far from IE coping, it fails to cope with the fixed positioning you've asked for whereas FF applies it correctly.

    Just an untried theory...

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,283
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Yes its the fixed positioning that is the problem.

    A fixed background image is always relative to the viewport and not its immediate containing element. This means that a fixed image will only show in the element it's placed in when that element happens to be over the position where you placed the image otherwise the image is invisible

  5. #5
    SitePoint Addict
    Join Date
    Apr 2003
    Posts
    332
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, folks. I appreciate your help.

    Andy


Bookmarks

Posting Permissions

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