Sub-menus and visited link color issue / CSS

Post your questions and problem reports here.

Sub-menus and visited link color issue / CSS

Postby Mitch » Sun Jan 24, 2010 1:23 am

I use php to "include" the MenuMaker generated menu on every page. I ran into the issue where the sub-menu items were displaying text using the "visited" color (as specified in the CSS) after I visited the link. It is basically using the link declarations in the CSS for the main page.

See Example: http://www.kitefly.com/example/linkcolorexample.png
In the example, notice that the "Easy GIF Animator" link is blue. This is the color I have set to visited links in the CSS.

To solve the menu item color issue, I added a CSS "visited link" declaration to the MenuManker CSS file and set the color value to the same color as the sub-menu text. I also had to set a "class" for every link. Although this idea works, unfortunately, MenuMaker does not add a class to every <a> tag in the generated code. This is too bad since I need to add a class into every link with good old "find and replace".

You can have any number of link styles on a page once you assign each one a class and specify the styles for each class. This solved my issue and gave me flexability to control the menu link colors separately from the main page (and prevent the 2 CSS files from stomping on each other). It would be nice if MenuMaker would be updated to add a class for each link when creating the menu code.

Example of what I added into the MenuMaker CSS (or you could also add it into your main CSS file). Note that I only added the CSS for "visited" links because that was the only one I was having problems with:
a.menumaker:visited {color: #ffffff;}

I also added a class to each <a> tag. For example:
<li><span class="ebul_imgcbmenu16x16" style="background-image: url('menu_files/cbsiicbmenu_7.gif')"></span><a class="menumaker" href="http://www.blumentals.net/support/" title="">Support Home</a></li>

Note: It is probably a better idea to add this declaration (a.menumaker:visited {color: #ffffff;}) into your site's main CSS file to prevent from having to add it to the MenuMaker CSS file each time you update your menus. It would be nice if MenuMaker was updated to include CSS declarations for links. That would solve the issue of having to manually update the file.

Does anyone know of a better way around this? I did find in another post where someone recommended changing the order of the specification of the link to the CSS file in the <head> section, but that didn't solve the issue for me.

It would be great if Blumentals would consider adding a common class tag to their links (in the generated code) or if they would generate the menu CSS that would take into account situations where there are multiple CSS style sheet declarations in use. My websites are pretty complex and typically use 3 externally linked style sheets.
Mitch
 
Posts: 7
Joined: Fri Nov 20, 2009 12:13 am

Re: Sub-menus and visited link color issue / CSS

Postby Karlis » Mon Feb 01, 2010 11:19 pm

I will place this in the to-do list. The idea sounds very reasonable.
Karlis Blumentals
Blumentals Software
www.blumentals.net
User avatar
Karlis
Site Admin
 
Posts: 3624
Joined: Mon Jul 15, 2002 5:24 pm
Location: Riga, Latvia, Europe

Re: Sub-menus and visited link color issue / CSS

Postby Mitch » Mon Feb 01, 2010 11:55 pm

Thanks for the consideration of my idea. It will certainly help me and hopefully others too.
Mitch
 
Posts: 7
Joined: Fri Nov 20, 2009 12:13 am

Re: Sub-menus and visited link color issue / CSS

Postby Aivars » Mon Feb 15, 2010 12:19 pm

Mitch,

what browser do you use? I've tried to reproduce your screenshot and so far a:visited color is used only outside the menu when displayed in any browser I tried. Can you send me a link with preview as private message, please?

Anyway, you don't need to add class to each anchor element. Open the Ebmm's generated CSS file and find a line like this: .ebul_mbproject td a { ... }. You can add style for visited links in menu just like this: .ebul_mbproject td a:visited { ... } or if you want them both to be the same, like this: .ebul_mbproject td a, .ebul_mbproject td a:visited { ... }.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2374
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Sub-menus and visited link color issue / CSS

Postby Mitch » Tue Feb 16, 2010 11:19 pm

Hi, I will put together an example and place it online and then let you know where you can view it. Due to my schedule, it might take me a couple of days to do that, but I will try to get it done sooner versus later.

I use IE 7 and FireFox 3.6. It didn't seem to be browser dependent.

My site is currently working since I added a class to the menu html and then set a visited color in my CSS for that class.
--Mitch
Mitch
 
Posts: 7
Joined: Fri Nov 20, 2009 12:13 am

Re: Sub-menus and visited link color issue / CSS

Postby Aivars » Wed Feb 17, 2010 2:27 pm

Mitch wrote:Hi, I will put together an example and place it online and then let you know where you can view it. Due to my schedule, it might take me a couple of days to do that, but I will try to get it done sooner versus later.


Excellent, thank you very much!
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2374
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia


Return to Easy Button & Menu Maker Support

Who is online

Users browsing this forum: No registered users and 3 guests

cron