Problems with my navigation

This is a discussion on "Problems with my navigation" within the Web Page Design section. This forum, and the thread "Problems with my navigation are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jun 15th, 2007, 14:28
Anonymous User
Guest
Posts: n/a
Problems with my navigation

Hi, I'm new to css and having managed to understand to an extent how navigation works, I've managed to create a menu for my page using the following code.

Linked .CSS file
Code: Select all
/* CSS Document */
body {
 background-color: #996600;
 text-align: center;
 padding: 0;
 margin: 3em;
}
#container {
 width: 100%;
 background: #FFFFD6;
 text-align: center;
}
#header {
 background-color: #FFFFD6;
 padding: 1em;
 text-align: right;
 }
#nav, #nav ul {
 float: left;
 width: 100%;
 list-style: none;
 line-height: 1;
 background: #996600;
 margin: 0 0 1em 0;
 color: #FFFFD6;
 text-align: left;
 white-space: nowrap;
}
#nav a {
 display: block;
}
#nav li {
 float: left;
 padding: 0;
 width: 7em;
 text-align: center;
}
#nav li ul {
 position: absolute;
 left: -999em;
 width: 5em;
 w\idth: 5em;
 font-weight: normal;
 margin: 0;
 text-align: left;
}
#nav li li {
 width: 5em;
}
#nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li.sfhover ul, #nav li li.sfhover ul, #nav li li li.sfhover ul {
 left: auto;
 text-align: left;
}
#nav li:hover, #nav li.sfhover {
 background: #FFFFD6;
 color: #996600;
 font-weight: bold;
}
#content {
 background-color: #FFFFD6;
 color: #996600;
 text-align: left;
 margin: 1em;
}
.htm file
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title>Menu 1</title>
<script type="text/javascript">
  sfHover = function() {
   var sfEls = document.getElementById("nav").getElementsByTagName("LI");
 for (var i=0; i<sfEls.length; i++) {
   sfEls[i].onmouseover=function() {
  this.className+=" sfhover";
   }
   sfEls[i].onmouseout=function() {
  this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
   }
 }
  }
  if (window.attachEvent) window.attachEvent("onload", sfHover);
</script>
<link href="temp.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="container">
  <div id="header"><img src="" alt="title goes here" name="placeholder" width="160" height="60" id="placeholder" style="background-color: #CCCCCC" /></div>
  <ul id="nav">
 <li>about</li>
 <li>buttons</li>
 <li>chairs</li>
 <li>contact</li>
 <li>gallery
   <ul>
    <li>gallery 1</li>
  <li>gallery 2</li>
   </ul>
 </li>
    <li>links</li>
  </ul>
  <div id="content">
    <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec tempor. Phasellus ultrices tellus sit amet enim. Ut metus elit, imperdiet eget, pulvinar in, viverra at, nunc. In vel tortor id diam condimentum dictum. Aliquam erat volutpat. Sed dapibus lacus at ligula. Nulla dolor tortor, aliquam at, hendrerit varius, euismod vitae, velit. Praesent sit amet urna. Nulla posuere. Fusce neque diam, feugiat a, porta eu, ultricies in, velit. Integer viverra. Mauris bibendum, justo non venenatis hendrerit, urna justo porta felis, at consequat est urna in ante. Morbi feugiat egestas leo. Pellentesque at tortor nec metus auctor sollicitudin. Curabitur a libero in leo egestas scelerisque. Curabitur vitae ligula. Nulla ut tortor convallis massa pulvinar condimentum. Praesent eu libero in urna congue ornare. Phasellus nec mauris.</p>
 <p>Praesent condimentum orci. Suspendisse ac lacus. Pellentesque sed purus. Praesent tempor congue lorem. Praesent eget diam. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Cras mollis. Suspendisse rhoncus. Duis eleifend, sapien in faucibus facilisis, massa urna varius orci, ut suscipit felis libero nec lectus. Morbi sed turpis. Aenean tincidunt, ligula et vulputate pretium, nibh lectus blandit eros, quis tristique augue magna a magna. Nullam quis est eu tellus gravida semper. Morbi blandit magna viverra nunc.</p>
  </div>
</div>
</body>
</html>
Sorry to be posting so much code.

My problem is that I want to have the menu items evenly spaced out across the navigation div are in the container div. Also, when viewing in IE7 the gallery drop downs don't come bellow, but to the side.

I've done quite a bit of searchin both on here and on the net in general and not been able to find a solution to the issues I've got.

Any help would be greatly appreciated.

Thank you.

Steve
Reply With Quote

  #2 (permalink)  
Old Jun 15th, 2007, 17:05
BGarner's Avatar
Reputable Member
Join Date: Oct 2006
Location: In front of the computer.
Posts: 213
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Problems with my navigation

Check this page out...

http://1ontheweb.net/downloads/Creat...enu_system.pdf

It describes how to make both a vertical and horizontal menu system driven by CSS.

Use that code and see how that works for you.
Reply With Quote
  #3 (permalink)  
Old Jun 15th, 2007, 21:35
Anonymous User
Guest
Posts: n/a
Thumbs up Great Tutorial

Thanks BGarner,

That tutorial was exactly what I was looking for when I've been googling etc. It's really good at explaining what the code is doing and I have a much better understanding now. I think I should be able to carry it out ok from what I have gathered from the tutorial.

Thanks again

Steve
Reply With Quote
  #4 (permalink)  
Old Jun 15th, 2007, 22:14
BGarner's Avatar
Reputable Member
Join Date: Oct 2006
Location: In front of the computer.
Posts: 213
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Problems with my navigation

Glad to help!
Reply With Quote
Reply

Tags
css, drop down, menu, navigation

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Navigation problems in safari mikka23 Web Page Design 5 Mar 24th, 2008 21:00
CSS Navigation Help! crackafaza Web Page Design 3 Jan 21st, 2008 15:56
Javascript navigation problems mikka23 JavaScript Forum 8 Sep 30th, 2007 12:22
CSS navigation AdRock Web Page Design 1 Jul 15th, 2006 10:56
Navigation problems... courtjester Flash & Multimedia Forum 3 Jan 27th, 2004 07:43


All times are GMT. The time now is 19:10.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43