Filling in the page with colour?

52 views Asked by At

So I'm trying to fill in the header part above the border fully in colour. But there seems to be like 3px of white space that's just bordering the entire page. I made the margin and padding for the entire page 0 so I'm a little confused. Here's the page code:

<DOCTYPE html?>
<head>
<title> Brittany Corl - Web Developer</title>
<link rel="stylesheet" href="CSSCoding.css">
<div id="MainHeader"><img id="HeaderPhoto" src="HeaderPhoto.png" height="100 px" width="100 px">
<center><h1>Brittany Corl - Web Developer/Graphic Designer</h1></center></div>
</head>
<body>
    <ul>
        <li><a href="home.html">Home</a></li>
        <li><a href="aboutme.html">About Me</a></li>
        <li><a href="myskills.html">Skills</a></li>
        <li><a href="work.html">Work</a></li>
        <li><a href="resume.html">Resume</a></li>
        <li><a href="contact.html">Contact</a></li>
    </ul>
</body>

here's the CSS:

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

h1 {
    font-family: tahoma;
    font-size: 40px;
    padding-top: 30px;
    padding-bottom: 29px;
    border-bottom: medium solid black;
}

#HeaderPhoto {
    float: left;
    padding-right: 20px;
}

#MainHeader {
    background-color: #e0ffff;
}

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

li {
    float: left;
    font-family: verdana;
    font-size: 20px;
}

a:link, a:visited {
    display: block;
    width: 120px;
    color: white;
    background-color: #99C0F2;
    text-align: center;
    padding: 4px;
    text-decoration: none;
    text-transform: uppercase;
}

a:hover, a:active {
    background-color: #5FA0F5;
}
2

There are 2 answers

0
Eric Shipman On

Try setting the margin and padding to zero for the body of the page.

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

or just add ,body after HTML

0
RKeeter On

Add the following to your css.

body {
margin: 0px;
padding: 0px;

}