Hi, quite new to css and as part of an assignment we have to create a set html page to look like it should using css. My problem(the relevant code is provided), is that the menu at the top where it looks like: first second
third fourth
I need it to be on only one line pushed right, and the box to be one line so like: first second third fourth (next to the right hand side).
I dont know which part of my css is doing this. Help would be appreciated.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>title</title>
<style>
body {
background-color: #c7c1c1;
font-family: Palatino Linotype, Georgia Times, Times New Roman, Serif;
}
div#centrepage {
margin-left: 150px;
margin-right: 150px;
margin: auto;
background-color: #5D2C2C;
max-width: 980px;
min-width: 450px;
}
div#navbar a {
text-decoration: none;
font-weight: bold;
color: grey;
}
div#navbar {
position: absolute;
top: 20px;
background-color: #5D2C2C;
padding: 0px;
min-width: 450px;
max-width: 980px;
text-align: right;
margin: auto;
}
div#navbar ul {
padding: 0;
margin: 0;
list-style: none;
}
div#navbar li {
float: left;
position: relative;
background-color: #5D2C2C;
min-width: 450px;
max-width: 980px;
}
li ul {
display: none;
position: absolute;
top: 1em;
left: 0;
}
li > ul {
top: auto;
left: auto;
}
li:hover ul {
display: block;
}
div#intro {
background-color: white;
padding-left: 5px;
padding-bottom: 5px;
padding-right: 5px;
margin-bottom: 11px;
padding-top: 1px;
}
h1 {
background-color: white;
padding: 40px;
}
</style>
</head>
<body>
<div id="centrepage">
<div id="thetitle">
<h1>H1</h1>
</div>
<div id="navbar">
<ul>
<li><a href="#intro">First</a></li>
<li><a href="#history">Second</a></li>
<li><a href="#national">Third</a></li>
<li><a href="#maritime">Fourth</a>
<ul>
<li><a href="#letters">1</a></li>
<li><a href="#numbers">2 </a></li>
</ul>
</li>
</ul>
</div>
<div id="wikilink">
<p>Information from <a href="http://www.wikipedia.com/en">Wikipedia</a></p>
</div>
</body>
</html>