brown2005 Posted February 23, 2009 Share Posted February 23, 2009 #top-bar { position: fixed; background-color: #2A2A2A; overflow: hidden; width: 100%; height: 30px; } i have that code for my top-bar which will be fixed at the top of the page permantly.. do i need to add top: 0; left: 0; as i have seen this in some places. Quote Link to comment https://forums.phpfreaks.com/topic/146489-position-fixed/ Share on other sites More sharing options...
haku Posted February 23, 2009 Share Posted February 23, 2009 You don't really have to, cause pretty much every browser defaults to top left, but it can be thought of as a good practice to explicitly state it on the off chance that some browser someday decides to render it some other way. I wouldn't bother myself though. Quote Link to comment https://forums.phpfreaks.com/topic/146489-position-fixed/#findComment-769109 Share on other sites More sharing options...
Goafer Posted February 23, 2009 Share Posted February 23, 2009 the only thing I would suggest is adding: html, body { margin: 0px; padding: 0px; } just to make sure that it doesn't leave a gap Quote Link to comment https://forums.phpfreaks.com/topic/146489-position-fixed/#findComment-769513 Share on other sites More sharing options...
TheFilmGod Posted February 23, 2009 Share Posted February 23, 2009 the only thing I would suggest is adding: html, body { margin: 0px; padding: 0px; } just to make sure that it doesn't leave a gap You could just do: * { margin, padding: 0px; } This is thefilmGOD's method of reseting defaults set by the browser. Quote Link to comment https://forums.phpfreaks.com/topic/146489-position-fixed/#findComment-769531 Share on other sites More sharing options...
jcombs_31 Posted February 23, 2009 Share Posted February 23, 2009 the only thing I would suggest is adding: html, body { margin: 0px; padding: 0px; } just to make sure that it doesn't leave a gap You could just do: * { margin, padding: 0px; } This is thefilmGOD's method of reseting defaults set by the browser. Did you really just refer to yourself in the third person? I would not just go handing that out as advice as it has noting to do with the original post. Quote Link to comment https://forums.phpfreaks.com/topic/146489-position-fixed/#findComment-769600 Share on other sites More sharing options...
TheFilmGod Posted February 23, 2009 Share Posted February 23, 2009 Yes, as a matter of fact I did. I dont' consider myself as TheFilmGod - it's simply a childhood nickname I got from my friends. So when I said "thefilmgod" I'm literally referring to the "old me." Quote Link to comment https://forums.phpfreaks.com/topic/146489-position-fixed/#findComment-769613 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.