Hi I have a web pay that is Divided into four sections:
Header
navigation area
main content area
footer
I have managed to place my navigation bar inside navigation area however the issue that I have I cannot seem to centre it. It is driving me nuts.
The other issue that I have is that my sub menus are all positioned the way they should be however the buttons below do not appear to have the same spacing as the ones above. I have enclosed a copy of my code and CSS.
If anybody can help I would be eternally grateful
Thanks Joel
CSS Code
*{
margin: 0;
padding: 0;
}
div#container {
width: 1024px;
margin: 10px auto;
}
header {
background-color: Pink;
min-height: 80px;
width: 960px;
margin-right: auto;
margin-left: auto;
}
#navmenu {
background-color: #ABC;
height: 80px;
width: 960px;
margin-right: auto;
margin-left: auto;
}
#main {
background-color: yellow;
min-height: 300px;
width: 960px;
margin-right: auto;
margin-left: auto;
}
footer {
background-color: #090;
min-height: 60px;
width: 960px;
margin-right: auto;
margin-left: auto;
}
/* Rules of Navigation Menu*/
/*=========================*/
ul#navmenu, ul.sub1, ul.sub2 {
list-style-type: none;
}
ul#navmenu li {
width: 145px;
text-align: center;
position: relative;
float: left;
margin-top: 4px;
margin-right: 4px;
}
ul#navmenu a {
text-decoration: none;
display: block;
width: 145px;
height: 25px;
line-height: 25px;
background-color: #fff;
border-radius: 5px;
}
ul#navmenu .sub1 li {
margin-top: 5px;
}
ul#navmenu .sub1 a {
margin-top: 3px
}
ul#navmenu .sub2 a{
margin-left: 9px;
}
ul#navmenu li:hover > a {
background-color: #cfc;
}
ul#navmenu li:hover > a:hover {
background-color: #FF0;
}
ul#navmenu ul.sub1 {
display: none;
position: absolute;
top: 20px;
left: 0px;
}
ul#navmenu ul.sub2 {
display: block;
position: absolute;
top: -5px;
left: 140px;
}
ul#navmenu li:hover .sub1 {
display: block;
}
HTML Code
<head>
</head>
<body>
<div id="container">
<header>
This is the Header
</header> <!--END OF HEADER DIV-->
<ul id="navmenu">
<li><a href="#">Home</a></li>
<li><a href="#">Holiday</a>
<ul class="sub1">
<li><a href="#">Travel</a>
<ul class="sub2">
<li><a href="#">Travel At A Glance</a></li>
<li><a href="#">Inbound</a></li>
<li><a href="#">Outbound</a></li>
<li><a href="#">Things To Remember</a></li>
</ul> <!--END OF TRAVEL SUB UNORDERED LIST-->
</li>
<li><a href="#">Cost</a></li>
<li><a href="#">Calender</a></li>
</ul> <!--END OF HOLIDAY SUB UNORDERED LIST-->
</li>
<li><a href="#">Disney</a>
<ul class="sub1">
<li><a href="#">Parks</a>
<ul class="sub2">
<li><a href="#">Magic Kingdom</a></li>
<li><a href="#">Epcot</a></li>
<li><a href="#">Animal Kingdom</a></li>
<li><a href="#">Hollywood Studios</a></li>
<li><a href="#">Typhoon Lagoon</a></li>
<li><a href="#">Blizzard Beach</a></li>
</ul> <!--END OF DISNEY PARKS SUB UNORDERED LIST-->
</li>
</ul> <!--END OF DISNEY SUB UNORDERED LIST-->
</li>
<li><a href="#">Non Disney</a>
<ul class="sub1">
<li><a href="#">Parks</a>
<ul class="sub2">
<li><a href="#">Sea World</a></li>
<li><a href="#">Universal Studios</a></li>
</ul> <!--END OF NON DISNEY PARKS SUB UNORDERED LIST-->
</li>
</ul> <!--END OF NON DISNEY SUB UNORDERED LIST-->
</li>
<li><a href="#">Shopping</a></li>
<li><a href="#">About</a></li>
</ul> <!--END OF MAIN UNORDERED LIST-->
<div id="main">
This is the main content area.</div> <!--END OF MAIN DIV-->
<footer>
This is the footer
</footer> <!--END OF HEADER DIV-->
</div> <!--END OF CONTAINER DIV-->
</body>
</html>
Header
navigation area
main content area
footer
I have managed to place my navigation bar inside navigation area however the issue that I have I cannot seem to centre it. It is driving me nuts.
The other issue that I have is that my sub menus are all positioned the way they should be however the buttons below do not appear to have the same spacing as the ones above. I have enclosed a copy of my code and CSS.
If anybody can help I would be eternally grateful
Thanks Joel
CSS Code
*{
margin: 0;
padding: 0;
}
div#container {
width: 1024px;
margin: 10px auto;
}
header {
background-color: Pink;
min-height: 80px;
width: 960px;
margin-right: auto;
margin-left: auto;
}
#navmenu {
background-color: #ABC;
height: 80px;
width: 960px;
margin-right: auto;
margin-left: auto;
}
#main {
background-color: yellow;
min-height: 300px;
width: 960px;
margin-right: auto;
margin-left: auto;
}
footer {
background-color: #090;
min-height: 60px;
width: 960px;
margin-right: auto;
margin-left: auto;
}
/* Rules of Navigation Menu*/
/*=========================*/
ul#navmenu, ul.sub1, ul.sub2 {
list-style-type: none;
}
ul#navmenu li {
width: 145px;
text-align: center;
position: relative;
float: left;
margin-top: 4px;
margin-right: 4px;
}
ul#navmenu a {
text-decoration: none;
display: block;
width: 145px;
height: 25px;
line-height: 25px;
background-color: #fff;
border-radius: 5px;
}
ul#navmenu .sub1 li {
margin-top: 5px;
}
ul#navmenu .sub1 a {
margin-top: 3px
}
ul#navmenu .sub2 a{
margin-left: 9px;
}
ul#navmenu li:hover > a {
background-color: #cfc;
}
ul#navmenu li:hover > a:hover {
background-color: #FF0;
}
ul#navmenu ul.sub1 {
display: none;
position: absolute;
top: 20px;
left: 0px;
}
ul#navmenu ul.sub2 {
display: block;
position: absolute;
top: -5px;
left: 140px;
}
ul#navmenu li:hover .sub1 {
display: block;
}
HTML Code
<head>
</head>
<body>
<div id="container">
<header>
This is the Header
</header> <!--END OF HEADER DIV-->
<ul id="navmenu">
<li><a href="#">Home</a></li>
<li><a href="#">Holiday</a>
<ul class="sub1">
<li><a href="#">Travel</a>
<ul class="sub2">
<li><a href="#">Travel At A Glance</a></li>
<li><a href="#">Inbound</a></li>
<li><a href="#">Outbound</a></li>
<li><a href="#">Things To Remember</a></li>
</ul> <!--END OF TRAVEL SUB UNORDERED LIST-->
</li>
<li><a href="#">Cost</a></li>
<li><a href="#">Calender</a></li>
</ul> <!--END OF HOLIDAY SUB UNORDERED LIST-->
</li>
<li><a href="#">Disney</a>
<ul class="sub1">
<li><a href="#">Parks</a>
<ul class="sub2">
<li><a href="#">Magic Kingdom</a></li>
<li><a href="#">Epcot</a></li>
<li><a href="#">Animal Kingdom</a></li>
<li><a href="#">Hollywood Studios</a></li>
<li><a href="#">Typhoon Lagoon</a></li>
<li><a href="#">Blizzard Beach</a></li>
</ul> <!--END OF DISNEY PARKS SUB UNORDERED LIST-->
</li>
</ul> <!--END OF DISNEY SUB UNORDERED LIST-->
</li>
<li><a href="#">Non Disney</a>
<ul class="sub1">
<li><a href="#">Parks</a>
<ul class="sub2">
<li><a href="#">Sea World</a></li>
<li><a href="#">Universal Studios</a></li>
</ul> <!--END OF NON DISNEY PARKS SUB UNORDERED LIST-->
</li>
</ul> <!--END OF NON DISNEY SUB UNORDERED LIST-->
</li>
<li><a href="#">Shopping</a></li>
<li><a href="#">About</a></li>
</ul> <!--END OF MAIN UNORDERED LIST-->
<div id="main">
This is the main content area.</div> <!--END OF MAIN DIV-->
<footer>
This is the footer
</footer> <!--END OF HEADER DIV-->
</div> <!--END OF CONTAINER DIV-->
</body>
</html>