#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2014
    Posts
    2
    Rep Power
    0

    Background Image


    I'm kind of a newbie at CSS and I have background image I want to add, but when I'm scrolling through the page the image repeats itself and when there's no repeat, it stretches the image. I'd like to know how to have the image stay in one spot but all the page content move when scrolling. (Kind of like the twitter page)
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    677
    Rep Power
    7
    Overall, it sounds this is what you may be aiming at.
    Code:
    background-image:url('image.ext');
    background-repeat:no-repeat;
    background-attachment:fixed;
    background-position:center;
    And one page I came across that seems rather descriptive.
    http://reference.sitepoint.com/css/background-position
    He who knows not and knows not he knows not: he is a fool - shun him. He who knows not and knows he knows not: he is simple - teach him. He who knows and knows not he knows: he is asleep - wake him. He who knows and knows he knows: he is wise - follow him
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2014
    Posts
    2
    Rep Power
    0
    Originally Posted by Triple_Nothing
    Overall, it sounds this is what you may be aiming at.
    Code:
    background-image:url('image.ext');
    background-repeat:no-repeat;
    background-attachment:fixed;
    background-position:center;
    And one page I came across that seems rather descriptive.
    http://reference.sitepoint.com/css/background-position
    Thanks! Helped a lot.

IMN logo majestic logo threadwatch logo seochat tools logo