Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Apr 2011
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Background image movement

    hi this is my first post so im sorry if its in the wrong place, i tried a search but couldnt find what i was looking for.

    my problem is that the site im making the main background image is moving to the left when the window is resized but the header and menu backgrounds are staying centered where i want them.

    this happens both in IE and FF

    here's a link to the construction page as you can tell it happens on all of them

    any help would be appriciated

    http://www.boltonroadallotments.co.uk/construction.htlm

    thanks

  • #2
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,956
    Thanks
    9
    Thanked 727 Times in 721 Posts
    Have a try with:

    Code:
    body {
        background-image: url("images/bg.png");
        background-position: center top;
    }
    
    #wrap {
        background-color: #FFFFFF;
        margin: 0 auto;
        width: 1070px;
    }

    margin:0 auto will centre the #wrap on your page regardless of the size of the viewport window, and the background-position: center will do the same for your background image.

    EDIT: Just realised you're in Silsden. I'm just up the road in Ilkley. Small world...

  • Users who have thanked SB65 for this post:

    ginner159 (04-25-2011)

  • #3
    New to the CF scene
    Join Date
    Apr 2011
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Haha it really is!

    I'll have a crack at it later on this week and let u know as I've got to go back to Uni for exams

    Just out of curiosity are there any improvements u think I could make or do u know of a php/database gallery I could use nt so fond of the one I've got auto update via FTP would be perfect

    Cheers

  • #4
    New to the CF scene
    Join Date
    Apr 2011
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    hey,

    i tried that but still to no avail

    ive decided to use a new style looks better and doesnt go funny

    thanks for your help anyway

  • #5
    New Coder
    Join Date
    Apr 2011
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You should be using absolute position for your images in CSS


  •  

    Tags for this Thread

    Posting Permissions

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