How to Get Rid of the White Strip Across the Top of My Webpage
- 1). Open your CSS file (this is a text file with the extension CSS) in the text editor.
- 2). Look for the code, which affects your main body tag. It should look something like this:
body {
code here
}
Look for the "margin" CSS tag. It may also say "margin-top." Set this to zero. If you do not have these in your body tag you can add it in. For example:
body {
margin:0;
}
Or
body {
margin-top: 0;
}
Next look for a padding tag in the body section. This can be "padding" or "padding-top." Set it to zero.
body {
margin:0;
padding:0;
}
This forces the website to go to the edges of the browser window. If you do not have a body tag in your CSS, add one following the last example. - 3). Repeat the last step for any container tags but only for margin and padding with "-top" after it. Container tags are usually called "#container" or "#wrapper." Not all web designs use them, but you want to make sure the design stays at the top of the browser. For example.
#container {
margin-top:0;
padding-top:0;
}
You can skip this step if you cannot find any "#container" or "#wrapper" tags in your CSS. - 4). Check the heading tag. This may be called "#header," "#head," or "#heading." This is usually where your top page banner is on your website. Again, make sure "margin-top" and "padding-top" are set to zero. Also check the height tag. If it is too tall it may be creating white space. For example:
#header {
margin-top:0;
padding-top:0;
height: 100px;
}
If your header image is only 50px tall, then 100px in the header may be too big. - 5). Save your file.
Source...