CSS dropdown menu problems

This is a discussion on "CSS dropdown menu problems" within the Web Page Design section. This forum, and the thread "CSS dropdown menu problems 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 Apr 2nd, 2008, 15:20
unitedcraig's Avatar
SuperMember

SuperMember
Join Date: Oct 2007
Location: Stockport
Age: 17
Posts: 825
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
CSS dropdown menu problems

I am not sure if this is possible, and sorry if it doesn't make that much sense

http://craigmoran.co.uk/home.php

What I want to do is instead of having a navigation bar, is just to have one link and have this as dropdown linking to the other pages.

What I need is

1. Help on a decent dropdown, I can hide the second links, it's just getting them to appear again that i struggle with
2. Is there a way through CSS to have the current dropdown display where it says home now if you get what i mean, for example, when the secondary links are hidden and dropping down, when i click on contact, is there a way through CSS to get this to appear where home is now, or would i need JS for this?

Sorry if this is a little confusing

thanks in advance

Craig

Ps. here's a link to my CSS

http://craigmoran.co.uk/style.css
__________________
Last Blog Entry: A Royal Mistake (Feb 20th, 2008)
Reply With Quote

  #2 (permalink)  
Old Apr 2nd, 2008, 21:49
Reputable Member
Join Date: Mar 2008
Location: Chester, UK
Age: 17
Posts: 345
Thanks: 2
Thanked 20 Times in 20 Posts
Re: CSS dropdown menu problems

like this one do you mean?

Link
Reply With Quote
  #3 (permalink)  
Old Apr 2nd, 2008, 22:33
unitedcraig's Avatar
SuperMember

SuperMember
Join Date: Oct 2007
Location: Stockport
Age: 17
Posts: 825
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS dropdown menu problems

Thanks mate

Anyone have any ideas on question 2 lol?
__________________
Last Blog Entry: A Royal Mistake (Feb 20th, 2008)
Reply With Quote
  #4 (permalink)  
Old Apr 3rd, 2008, 18:30
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,268
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Re: CSS dropdown menu problems

Number 2 would require manual updating or *maybe* a PHP script.
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote
  #5 (permalink)  
Old Apr 3rd, 2008, 19:22
unitedcraig's Avatar
SuperMember

SuperMember
Join Date: Oct 2007
Location: Stockport
Age: 17
Posts: 825
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS dropdown menu problems

Thanks mate, will look into it
__________________
Last Blog Entry: A Royal Mistake (Feb 20th, 2008)
Reply With Quote
  #6 (permalink)  
Old Apr 3rd, 2008, 21:15
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,761
Blog Entries: 1
Thanks: 0
Thanked 18 Times in 18 Posts
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: CSS dropdown menu problems

For # 2 Do this

1. Append an ID to the <body> tag of each page i.e. <body id="contactPage"> then in your CSS you duplicate say your CSS hover state and name it

#contactPage #nav ul li#contact a {
style here
}

I did that on my page http://mevans76.com so each nav highlights based on the page you are on. No PHP/JS needed. And its all in the CSS so no changes to your actual pages are required to update.

for example my page has a very basic nav no menus so my CSS looks like this to cover them all in the CSS in a single declaration.

Code: Select all
/* states based on page ID */
#homePage #nav li#homeNav a, #contactPage #nav li#contactNav a, #aboutPage #nav li#aboutNav a, #playgroundPage #nav li#playgroundNav a, #downloadsPage #nav li#downloadsNav a, #sitemapPage #nav li#sitemapNav a, #archivesPage #nav li#archivesNav a, #blogPage #nav li#blogNav a, #photoPage #nav li#photoNav a {
    border-top:solid 2px #FFF;
}
as for #1 it is as simple as

Code: Select all
#nav ul li:hover ul {
style for nested UL's here
}
And to hide the nested UL's you just do

Code: Select all
#nav ul li ul {
display:none;
}
Of course you will need a .htc file like Whatever Hover to make it work for IE, but that is no biggie at all either. Its well documented.
__________________
The internet is just a fad.
http://www.mevans76.com
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)

Last edited by moojoo; Apr 3rd, 2008 at 21:23.
Reply With Quote
  #7 (permalink)  
Old Apr 3rd, 2008, 22:31
unitedcraig's Avatar
SuperMember

SuperMember
Join Date: Oct 2007
Location: Stockport
Age: 17
Posts: 825
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS dropdown menu problems

Thanks for that , will defo take a look at all ideas
__________________
Last Blog Entry: A Royal Mistake (Feb 20th, 2008)
Reply With Quote
Reply

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
Dropdown menu from logo freddylaval JavaScript Forum 3 Jan 13th, 2008 16:27
menu, dropdown everland Flash & Multimedia Forum 2 Aug 21st, 2007 14:58
CSS dropdown menu problem in IE Tino Web Page Design 2 Jun 3rd, 2007 08:48
New window from dropdown menu magiccupcake JavaScript Forum 5 Jan 2nd, 2007 01:10
Dropdown menu Jorgerb Flash & Multimedia Forum 6 May 17th, 2005 08:29


All times are GMT. The time now is 22:11.


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