"crhaynes" <cr*************@mail.forum4designers.com> wrote in message
news:cr*************@mail.forum4designers.com...
I'm having trouble with my CSS. My links are black, my hover is orange,
and my active link is red. When I select a link it turns red but it
does not retain that color when the selected page loads. Is it
possible to retain that color?
If the old page has been replaced by a new page, how is it that the link you
clicked is even showing?
If you mean that the new page has the same links on it as the old page, then
the answer is that when a page loads, the active element on it isn't an
element that happens to look like the element that you clicked on the
previous page. The active element on the new page, if there is one, will be
the same as it would be if you had gone to that page directly.
Maybe what you're trying to do is to get the link--probably on a navigation
bar--that corresponds to the *current* page to have a different appearance
from the other links on the nav bar, *regardless* of how you got to that
page. That's a different question from the one you asked. You can accomplish
that with a stylesheet with code like the following:
#navlinks a { /* regular nav bar link properties */ }
#pageA #linkA,
#pageB #linkB,
#pageC #linkC,
#pageD #linkD { /* properties of the link to the current page */ }
and HTML like this:
<body id="pageC">
...
<div id="navlinks">
...<a id="linkA">...</a>...
...<a id="linkB">...</a>...
...<a id="linkC">...</a>...
...<a id="linkD">...</a>...
</div>
...
On page A, the body would have id="pageA", etc. Link "linkA" points to page
A, etc. The DIV with id="navlinks" contains the entire nav bar.