Horizontal menu help needed

This is a discussion on "Horizontal menu help needed" within the Web Page Design section. This forum, and the thread "Horizontal menu help needed 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 Sep 28th, 2006, 10:01
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdRock
Horizontal menu help needed

I created a CSS menu using the tutorial that is linked in the sticky thread at the top of this forum and I have got it working without Javascript

What I am wandering is, is there a way i can have the li class="submenu" evenly spaced. Some of my headings are longer than others so the spacing between look untidy

I would like the spacing between headings to be evenly distributed

HTML: Select all
<div id="navigation">
<ul class="level1">
    <li><a href="home.php">Home</a></li>
    <li class="submenu">Civil Engineering
 <ul class="level2" id="sub1">
     <li><a href="general.php">General</a></li>
     <li><a href="management.php">Management</a></li>
 </ul>
    </li>
Reply With Quote

  #2 (permalink)  
Old Sep 28th, 2006, 11:12
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: Horizontal menu help needed

I take it there is more to your navigation code that this. If not what's here is missing some code.

Not sure what you are getting at with the spacing. You should know by now to put the page somewhere where we can see what you see. Then we might have an idea what you are trying to tells us.
Reply With Quote
  #3 (permalink)  
Old Sep 28th, 2006, 11:24
Reputable Member
Join Date: Dec 2005
Location: scotland
Age: 27
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Horizontal menu help needed

If i understatnd what you meani think you could

.submenu{

margin-left : ??px;
margin-right : ??px;}

otherwise you could set a fixed width?

not sure excatlly what you wantin. let us know if that helps
Reply With Quote
  #4 (permalink)  
Old Sep 28th, 2006, 12:54
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdRock
Re: Horizontal menu help needed

http://www.jackgodfrey.org.uk/test/index.php

Here is the URL for the test page. you'll be able to see what i mean with the nav bar. None of the headings are symetrical.

I have used the code that was given in the tutorial and it all looks perfect apart from the headings
Reply With Quote
  #5 (permalink)  
Old Sep 28th, 2006, 17:26
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: Horizontal menu help needed

It's this piece of css that's primarily determing the spacing of your menu items.
Code: Select all
div#navigation ul.level1 a {
   width: 130px;
}
Your menu doesn't work right in Firefox either.

There are a number of other css problems and I think you will find that I didn't tell you to include the 'csshover.htc' file the way you have done.

Don't name styling blocks, style1, style2, etc. Give them meaningful labels.

You need to go back and read some more.
Reply With Quote
  #6 (permalink)  
Old Sep 30th, 2006, 09:04
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdRock
Re: Horizontal menu help needed

I have a question about the tutorial

with regards to this bit

Quote:

Now if you include this in your main stylesheet it will not validate. So in case this is
important to you, and it should be, save this code in a separate file. I call mine:
ieonly.css
And then call this file from within your xhtml pages using the following lines of code:
<!--[if lte IE 6]>
<link rel="StyleSheet" type="text/css" href="ieonly.css" />
<![endif]-->
What if i'm using php. Do i still use the
<!--[if lte IE 6]> bit on my page?

Reply With Quote
  #7 (permalink)  
Old Sep 30th, 2006, 13:25
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: Horizontal menu help needed

Yes.

Just make sure you put it in the right place iin your code depeneding on whether your page is generated entirely from php or is basically an html page with some php code embedded.
Reply With Quote
  #8 (permalink)  
Old Oct 1st, 2006, 21:41
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdRock
Re: Horizontal menu help needed

I have my menu working perfectly ow but have one query

This is my menu
HTML: Select all
<div id="navigation">
 <ul class="level1">
         <li><a href="/index">Home</a></li>
         <li class="submenu">Civil Engineering
  <ul class="level2" id="sub1">
          <li><a href="/general">General</a></li>
          <li><a href="/management">Management</a></li>
  </ul>
         </li>
         <li class="submenu">Construction
      <ul class="level2" id="sub1">
          <li><a href="/designandbuild">Design and Build</a></li>
          <li><a href="/drainage">Drainage</a></li>
          <li><a href="/groundwork">Groundwork</a></li>
      </ul>
         </li>
         <li class="submenu">Water
      <ul class="level2" id="sub1">
          <li><a href="/leakageandpipelines">Leakage and Pipelines</a></li>
          <li><a href="/trenchlessinstallations">Trenchless Installations</a></li>
      </ul>
         </li>
         <li class="submenu">Contact Us
      <ul class="level2" id="sub1">
          <li><a href="/contactus">Contact Details</a></li>
          <li><a href="/enquiryform">Enquiry Form</a></li>
      </ul>
         </li>
         <li class="submenu">Information
      <ul class="level2" id="sub1">
          <li><a href="/aboutus">About Us</a></li>
          <li><a href="/news">Current News</a></li>
          <li><a href="/missionstatement">Mission Statement</a></li>
      </ul>
         </li>
 </ul>
    </div>
What i want to know is how can i remove the hover effect from this line
HTML: Select all
<li><a href="/index">Home</a></li>
At the moment when hovered over it turns blue which is to do with this bit
Code: Select all
 
div#navigation li a:hover {
color: #FFF;
background-color: #00F;
}
How do i chnage it so just the first link isn't affected using that code? I don't want any hover at all just plain

Last edited by AdRock; Oct 1st, 2006 at 21:44.
Reply With Quote
  #9 (permalink)  
Old Oct 2nd, 2006, 17:48
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Horizontal menu help needed

Add these:

Code: Select all
<li class="home"><a href="/index">Home</a></li>
Code: Select all
div#navigation li.home a:hover {
    color: #000;
    background-color: transparent;
}
Reply With Quote
  #10 (permalink)  
Old Oct 2nd, 2006, 17:50
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Horizontal menu help needed

I forgot to mention... The menu looks horrid in Safari. The blue boxes that appear on the hover extend out past the boundaries of the <ul> the links are in. Also, the lines separating the links only go a little more than halfway across the box.

Consider using something other than specific widths for the top level list elements, too. They're all uneven and it looks rather tacky.
Reply With Quote
Reply

Tags
horizontal, menu, help, needed

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
Help needed on horizontal css menu dreamabstract Web Page Design 1 Apr 24th, 2008 16:51
CSS Horizontal Menu Bar - IE Problems!! swillicott Web Page Design 47 Jul 23rd, 2007 21:42
CSS horizontal menu trademarkd Web Page Design 1 Jan 9th, 2007 07:10
CSS Horizontal drop-down menu ??? j4mes_bond25 Web Page Design 2 Apr 6th, 2006 16:10
horizontal drop-down menu da_stimulator JavaScript Forum 2 Nov 4th, 2004 11:16


All times are GMT. The time now is 04:29.


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