HighDots Forums  

Retain Active Link color on selected page

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Retain Active Link color on selected page in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
crhaynes
 
Posts: n/a

Default Retain Active Link color on selected page - 08-26-2004 , 01:45 PM







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 i
does not retain that color when the selected page loads. Is i
possible to retain that color?

My navigation that i'm trying to get this corrected on is
server-side
include


-
crhayne
-----------------------------------------------------------------------
Posted via http://www.forum4designers.co
-----------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message112989.htm


Reply With Quote
  #2  
Old   
David Dorward
 
Posts: n/a

Default Re: Retain Active Link color on selected page - 08-26-2004 , 05:35 PM






crhaynes wrote:
Quote:
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.
Of course not, when you go to the other page the link is no longer being
activated (clicked on, or key pressed while focused).

Quote:
Is it possible to retain that color?
Not without altering the markup of the page (e.g. class selectors).

Quote:
------------------------------------------------------------------------
Posted via http://www.forumXdesigners.com
------------------------------------------------------------------------
View this thread: http://www.forumXdesigners.com/message112989.html
Please get a real newsreader.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


Reply With Quote
  #3  
Old   
Lee K. Seitz
 
Posts: n/a

Default Re: Retain Active Link color on selected page - 08-26-2004 , 09:28 PM



In article <crhaynes.1bmcaf (AT) mail (DOT) forum4designers.com>,
crhaynes <crhaynes.1bmcaf (AT) mail (DOT) forum4designers.com> wrote:
Quote:
I'm having trouble with my CSS. My links are black,
I hope your normal text isn't black, then. Some of us weirdos turn
off underlining links. (I prefer hover, myself.)

Quote:
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?
As the other reply said, no. However, you didn't mention setting your
visited link color to anything. Is that what you're asking about?
You use a:visited for that. For the colors to display properly, they
must be in this order in your stylesheet:

a:link
a:visited
a:hover
a:active

Quote:
My navigation that i'm trying to get this corrected on is a
server-side include.
That should be irrelevnt.

--
lkseitz (Lee K. Seitz) .at. hiwaay @dot@ net
"I'm down with Bill Gates, I call him Money for short
I phone him up at home and I make him do my tech support"
-- "Weird Al" Yankovic, "It's All About The Pentiums"


Reply With Quote
  #4  
Old   
Vincent Poinot
 
Posts: n/a

Default Re: Retain Active Link color on selected page - 08-27-2004 , 03:57 AM



crhaynes wrote:
Quote:
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?

I'm not sure to understand what you mean, but you might want to set your
visited links as red too: a:visited { color: red ; } (fine-tune this
rule according to your needs).


--
Want to spend holidays in France ? Check http://www.relinquiere.com/


Reply With Quote
  #5  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: Retain Active Link color on selected page - 08-31-2004 , 10:45 AM




"crhaynes" <crhaynes.1bmcaf (AT) mail (DOT) forum4designers.com> wrote

Quote:
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.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.