473,771 Members | 2,328 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help needed with Drop Down Menu in CSS

1 New Member
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 1804
dswethar
65 New Member
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
2965
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 "frames"). Do you think this is true> 2. Some people think they take up too much KB. 3. Some people are worried that people who have javascript turned off wont be able to see them. What percent of web users have javascrips turned off? I thought it was...
10
3486
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 there is no drop down menu functionality at all. I wanted to implement an alternative stylesheet for IE, but my link to it is apparently broken. What is wrong with my link? I'd
7
3615
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> </head> <style type="text/css">
2
2583
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 disappears). Is there a way, I can keep the menu always on top. ( A good example of what I'm looking for is similar to the menu bar in http://www.milonic.com/ ).
4
2667
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 problem only in IE, in firefox it works ok. Is there a solution to this problem? I tried to hide the drop down when the menu opens but sometimes the menu covers only a small part of the drop down, but enough to obscure the menu choice. I would...
0
5576
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 ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
4
9296
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 if it works, and if it does not, tell me why it does not work. Thanks.
5
1388
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 name "city" for all the records in that table. This will filter drop down menu 2 to show all customers who are based in the city that drop down menu 1 shows. Drop down menu 2 can then open up the record as a form for that customer. Hope that...
6
2800
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 object taller and i then can see them, but that leaves a big area that is blank. Is there a way to over come this? (this may be a flash forum question)
0
9619
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10102
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9910
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.