好的,所以我在这里尝试了很多不同的东西,但我似乎无法让我的菜单栏在页面上一直延伸。左侧有一个小小的差距。我在这里错过了什么吗?如何让我的菜单栏居中并一直延伸?
到目前为止,这是我能够让页脚稍微集中在页面底部的唯一方法。每次将左右页边距设置为自动时,都会使页脚与菜单栏保持一致。有没有更好的方法来做到这一点?
谢谢。
<!DOCTYPE html>
<html>
<head>
<title>Connor Lepert: Homepage</title>
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
<link rel="icon" href="logo.png">
<style>
@font-face {
font-family: Vanadine;
src: url(vanadine.ttf);
}
body {
background-image: url(bckgrnd.jpg);
background-size: 100%;
background-repeat: no-repeat;
font-family: sans-serif;
color: white;
}
a {
color: white;
font-family: Vanadine;
text-decoration: none;
}
a:hover {
color: yellow;
}
p {
color: white;
font-family: Vanadine;
}
footer {
position: fixed;
display: block;
margin-left: 45%;
margin-right: 45%;
text-align: center;
margin-top: 320px;
}
#siteid {
margin-left: auto;
margin-top: auto
}
#menubar {
background-color: #ABADB0;
width: 100%;
height: 20px;
display: block;
margin-left: auto;
margin-right: auto;
margin-top: auto;
text-align: center;
word-spacing: 20px;
position: fixed;
}
#header {
display: block;
margin-left:auto;
margin-right: auto;
text-align: center;
margin-top: 330px;
}
</style>
</head>
<body>
<div id="siteid"><img src="logowhite.png" width="50px" alt="Personal logo"/></div>
<div id="header"><img src="header.png" width="400" alt="Lepert"/></div>
<div id="menubar">
<a href="index.html">Home</a>
<a href="aboutme.html">About</a>
<a href=mailto:[email protected]>Contact</a>
<a href="portfolio.html">Portfolio</a>
<a href="scrapyard.html">ScrapYard</a>
</div>
<footer>©<a href=> 2015 by Connor Lepert </a> <br> <p></p> </footer>
</body>
</html>