- This topic is empty.
-
AuthorPosts
-
July 4, 2011 at 5:26 am #33364
benji_flip134
Participanthi 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;
}July 4, 2011 at 6:59 am #82799benji_flip134
Participantno i didn’t how i had to use a reset. what’s the code for it and how does it work?
July 4, 2011 at 8:50 am #82803wolfcry911
Participantdoes the scrollbar appear on the home page but not the new about page?
July 4, 2011 at 8:59 am #82804benji_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.
July 4, 2011 at 9:15 am #82805wolfcry911
ParticipantI’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…
July 4, 2011 at 9:28 am #82807benji_flip134
Participantawesome 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!
July 4, 2011 at 10:16 am #82809wolfcry911
Participantfor 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
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.