Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS beginner to css – background question

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #33364
    benji_flip134
    Participant

    hi i’m making my first website and i’ve made the home page which has a header/navigation created from an unordered list. Now i made my about page and applied the body without the header/navigation yet. However i notice when i switch between the two pages the background image shifts a few pixels to the right; I’m guessing it has something to do with unordered list as i haven’t added it in yet. Is this normal css behaviour? thanks in advance

    Here is my body css if it helps:

    body {
    background-color: #000;
    background-image: url(../images/bg.jpg);
    background-repeat: no-repeat;
    background-position: center top;
    height: auto;
    width: auto;
    }

    #82799
    benji_flip134
    Participant

    no i didn’t how i had to use a reset. what’s the code for it and how does it work?

    #82803
    wolfcry911
    Participant

    does the scrollbar appear on the home page but not the new about page?

    #82804
    benji_flip134
    Participant

    @wolfcry911. yes it does! you must now what im doing wrong. I’ve read a bit about the CSS reset but i don’t think thats the fix since im only viewing it one browser – firefox.

    #82805
    wolfcry911
    Participant

    I’d like to say that not everyone agrees with resets (probably me and 6 others ;) ). They are very popular and used by the masses, but most people don’t even know why they’re used. The reset is usually redundant or not used at all – just a waste of bandwidth (albeit tiny). Further, I see it recommended as a solution to problems all the time, when 95+% of the time it has nothing to do with the problem. This is not dig against sl1dr – (s)he definitely knows what he/she is talking about and has helped a good many people.

    The probable (I still haven’t seen the page) ‘problem’ is that the home page has more content than the about page and requires the browser to have a scrollbar, where the about page doesn’t. IE reserves room for a scrollbar but most browsers don’t. In reality, most people won’t even notice the shift. If it bothers you, you could force a scrollbar with

    html { overflow-y: scroll; }

    I personally wouldn’t bother…

    #82807
    benji_flip134
    Participant

    awesome that worked perfectly. On another topic how do you post code in these forums and is it possible to to quote posts too? i can’t seem to find them, thanks again!

    #82809
    wolfcry911
    Participant

    for posting code just use the code tags provided above the message text box (next to the bold and italic tags). for quotes, I usually just copy and paste into italics

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.