Skip to:
Content
Pages
Categories
Search
Top
Bottom

Changing the background image "repeat"

  • I currently am using a background image for my site that is repeated but I want to change it to something I don’t want to repeat.

    I can’t seem to find the tag and everytime I try the following in style.css but no success:

    #img.source-image {

    width: 100%;

    position: absolute;

    top: 0;

    left: 0;

    }

    Any further suggestions would be greatly appreciated,

    RedBull

Viewing 3 replies - 1 through 3 (of 3 total)

  • _ck_
    Participant

    @_ck_

    Better places than here for css advice but this one is easy

    http://www.w3schools.com/css/css_background.asp

    no-repeat is what you want.

    That CSS would only change an image that has the id “img” and a class “source-image”, i.e.

    <img id="img" class="source-image" src="...etc..." />

    It seems like you’re trying to make an image the full size of the page which isn’t a sensible solution.

    The style you need to use is

    background: url(theimage.jpg) left top no-repeat;

    and you should probably be applying it to the body

    so

    body
    {
    background: url(theimage.jpg) left top no-repeat;
    }

    and if you want the background to not scroll with the document

    body
    {
    background: url(theimage.jpg) left top no-repeat fixed;
    }

    theimage.jpg must be relative to the style sheet or absolute.


    RedBull
    Member

    @redbull

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar