I'm just starting out making simple webpages using HTML and CSS and I wanted to center my content in the middle of the page. With my code, I have the content centered from the left and the right, but I wanted to also center it from top and bottom. If you were to test my code, you would see that there is no spacing at the top. How would I fix this to have center from not only left and right but from top and bottom?
My CSS code looks something like this:
body {
width: 100%;
height: 100%;
background-color: green;
}
#homePage {
width: 960px;
height: 600px;
background-color: white;
margin: 0 auto;
}
My html code looks like this:
<body>
<div id="homePage">
<header> Logo and Twitter </header>
<ul id="pageNav">
<li><a href="index.html">Home</a></li>
<li><a href="features.html">Features</a></li>
<li><a href="purchase.html">Purchase</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
<footer> Content for footer goes here </footer>
</div>
</body>