Search code examples
htmlcsswhitespace

White line appearing on all sides of web page


I'm sorry I cannot show you the code, it is currently on my localhost.

I am pretty sure I have correctly typed the code because Netbeans doesn't show any errors. I am making my parents website for their charity, Enough to Spare. When I load the webpage though, there is a white line on all sides (although you can't see the top line because that div is white) Here is a screenshot. enter image description here Anyone have any suggestions?


Solution

  • I would recommend you use a reset.css file before your own.css, so you start with a blank slate.

    You could always add -

    html { width:100%; height:100%; margin:0 padding:0; }
    body { width:100%; height:100%; margin:0; padding:0; }
    

    http://www.cssreset.com/ - This is where I look to get my reset.css file

    Thank you to Dan Ovidiu Boncut for reminding me to put in margin:0; and padding:0;!

    Ninja edit: Have you tried using the Chrome Developer Tools? You can play with the css using that. Right click on an element and click on inspect, there you can add new css styles and edit your current ones. It is a brilliant way to find solutions to your css issues... it also shows you what line in your css file you're at, so when you come to make the changes in file you know where to look straight away! :)