SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2001
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS Floating Background Image

    Hello,

    I am wanting to add a background image to a CELL which will stay at the top of the page as you scroll down.

    The cell runs the whole length of the page and is the first in a sweries of 3 columns.

    Please could you tell me how to implement this.

    Thanks a lot.

    etocia

    my site http://www.sjtennis.com is up for review http://www.sitepointforums.com/showt...threadid=31175
    http://www.sjtennis.co.uk
    St.Andrews Junior Tennis

  2. #2
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've seen this done with CSS and layer elements in there -- so I know it can be done.

    I'll be looking for a solution for you (so you know this thread isn't being ignored) -- but I'm sure someone else will give you the solution before I can.

    That's the way these forums work!
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2001
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    someone told me .....

    someone told me this

    "And while we're talking about that, a nice trick (well a trick that I like, is to fix it, so that the text scrolls over the top of it). If you take my advice and let the stylesheet deal with this kind of stuff, use this:

    body { background: url(yourimage.gif);
    background-position: center;
    background-repeat: no-repeat;

    }"

    but i thought that it would only work for the whole page and would not be inside a cell. i tried applying the css to the cell but the image did not follow the scroll.

    thanks.
    http://www.sjtennis.co.uk
    St.Andrews Junior Tennis

  4. #4
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No....

    The text will be on top of the image because it is a background image.

    But that will not accomplish what you're wanting to simply because that CSS code only makes that image a background image -- nothing more.
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.

  5. #5
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    etocia...please try to avoid posting duplicate messages ok?

    Good luck.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  6. #6
    SitePoint Enthusiast
    Join Date
    Aug 2001
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    yeah

    i thought that was all the CSS did! I really want to find a solution to this as I have seen it done a few times.

    basically i want a bg image to a cell that stays still when you scroll - ie lets text move over it.

    Thanks

    and sorry about the double posting - i did not realise!
    http://www.sjtennis.co.uk
    St.Andrews Junior Tennis

  7. #7
    SitePoint Enthusiast PHP_Nut's Avatar
    Join Date
    Aug 2001
    Location
    NY, USA
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The Solution

    Code:
    <body background ="yourimage.gif" bgproperties="fixed">
    Ian Gordon
    PHP & MySQL coder
    "Coding is like riding a bike, with a little practice, u won't hurt urself

  8. #8
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Etocia...you cannot apply a fixed background to a TABLE cell.

    The TABLE cell must scroll as it is part of the page. If you absolutely MUST have an image stay fixed then you will have to put it as a background for the BODY tag.

    People have given you plain HTML code and a CSS alternative. Those are your only options.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes


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
  •