Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
How to Absolute Pos. Website with no gap at top and don't lose left side of page?
This problem has bugged me for a while. Using the:
margin: 0 auto;
method, YES centers it but has that annoying bloody gap at the top of the page!
However the absolute positioning method:
#html, #body {
height: 100%;
margin: 0;
padding: 0;
padding-left: 1px;
border: 0;
}
#MainCont {
width: 900px;
height: auto;
border: 2px solid #BACFCF;
margin: 0;
margin-right: -450px;
padding: 0;
position: absolute;
top: 0px;
right: 50%;
text-align: left;
}
with the push 50% then subtract half the width in the margin centers the page, removes the gap but for all i try when the page becomes small enough for scroll bars starts losing the left side.
I use this method as i figure most circumstances size wont go bellow 900px but it bugs me and id like to get it so as it stops at the edge and scrolls properly.
Any ideas? I'd really love this solved.
1 Answer
- Alan LLv 49 years agoFavorite Answer
Check out w3schools (link below) for information. Use the "Try it yourself" for experimentation.