change link for current page
Posted: 06 May 2009 06:00 PM   [ Ignore ]
Newbie
Rank
Total Posts:  9
Joined  2008-02-11

I am trying to use CSS to change the appearance of the link for the current page in the menu bar.

The concept is to provide an ID for the body tag and an ID for the href and then reference the href ID as a descendant of the body id in the CSS file. So the change only takes place for the page that is current, and only that link gets changed.


[ comment added ] Strangely enough I found that the post shortly before this addresses this same issue - see post “How to load a new menu bar content from horizontal menu bar to the left side menu bar? ” I did not recognize that it covered the same issues from the title.

So I have the following code for the body tag:

<body id="home"

And for the hrefs I have the following:

<a href="home.html" id="home1">&nbsp;&nbsp;Home&nbsp;&nbsp;</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              <
a href="about.html" id="about1">&nbsp;&nbspAbout&nbsp;&nbsp;     </a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              <
a href="updates.html" id="updates1">&nbsp;&nbspUpdates&nbsp;&nbsp;</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              <
a href="join1.html"id="join1">&nbsp;&nbsp;Join/Contact&nbsp;&nbsp;</a

And in the CSS I have tried all kinds of things, but nothing I have tried works. I think I need an ‘a’ marker in their somewhere. I have looked on line for documentation on using descendants with IDs, but I keep getting stuff about descendants using classes.

So how do I reference the href with ID ‘home1’ within the body with id ‘home’ to change attributes on the href (text or background color for instance)?

thanks
GALJohnson

Profile