473,394 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Help needed with Drop Down Menu in CSS

I have got a basic drop down menu written using CSS (complete with moving highlight & functioning dropdown where needed) but I have a couple of problems.

1. The original (non-dropdown) menu was based in a table so the widths of the columns could be amended per column and they grew as the browser window grew and the entire menu width could be set to be exactly the same width as the banner heading (100% table width).

I've now started to alter it to a CSS dropdown menu but when I specify the width of each menu item in px I can't get the full width exactly the right size and all columns also the same width as each other. Any way around this?

2. I want to use the same menu code for each page of my site. Currently when I hover over a menu item, it changes colour (a highlight). But I also want to know which page I am on in the site so when I change pages I want it's menu item to be automatically highlighted as well as the moving highlight on :hover. I read this can be done in CSS but I'm blowed if I can find that article again! Help!
Nov 7 '06 #1
1 1791
MenuItem {Color:black}
MenuItem A {Color:red}
MenuItem A:hover {color:white}

You can assign the class MenuItem to the menu table.

If a menu item is not hyperlinked(in <a> tags), the colour will be black.

If it is hyperlinked, the colour will be red and will change to white on mouseover.

So - you neednot hyperlink the menu when that page is opened.

If you still want to hyperlink, create another class and assign that class to each of the menu items when that page is open.

You can modify the css accordingly. This is just an example.

Hope this is what you are looking for...
Nov 7 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: KK | last post by:
Drop-down menus are the hottest thing since Wonder Bread but . . . 1. Alot of people put them in the they-look-nice-but-you-cant-code-them-right-so-they-always-look-messed-up category (a la...
10
by: Haines Brown | last post by:
I've implemented the horizontal drop down menu discussed recently in this newsgroup, and it works nicely under Galeon and Mozilla, but not IE 5.0. Here are the problems: Under IE 5.0, the...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
2
by: hemanth.singamsetty | last post by:
Hello there, I've a drop down menu (created using CSS & Javascript -- see code below). My problem is, whenever I click a link on the menu the new page replaces the current page (and the menu...
4
by: simon.cigoj | last post by:
I have an javascript made menu and some forms with the dropdown element. When the menu opens and scrolls down the drop down is displeyed over the menu and obscures the menu choices. I have this...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
4
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
5
by: Marks | last post by:
Ok Guys, Was hoping if you could help me. I want to create a drop down filter in Access Forms. This names and fields are just examples. I basically want drop down menu 1 to show the field...
6
by: mmurphmsu | last post by:
I have created my flash menu, complete with drop down boxes. Published the file so that i can get the html code. But when i try to get the drop downs to work, you can see them. So i make the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.