473,322 Members | 1,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Retain Active Link color on selected page


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

Jul 20 '05 #1
4 20202
crhaynes wrote:
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).
Is it possible to retain that color?
Not without altering the markup of the page (e.g. class selectors).
------------------------------------------------------------------------
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
Jul 20 '05 #2
In article <cr*************@mail.forum4designers.com>,
crhaynes <cr*************@mail.forum4designers.com> wrote:

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.)
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
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"
Jul 20 '05 #3
crhaynes wrote:
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/
Jul 20 '05 #4

"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.

Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mark R | last post by:
I have one .asp page with a SELECT pulldown list on it and some INPUT fields. When SUBMIT is clicked the form data is submitted to that same page and validated. If INPUT fields are empty the asp...
6
by: Carla | last post by:
hi people, I have a little problem that I can't solve with css and i was wondering if you could help me. I have 4 links, I want that when I click/mouseover in the link 1, it turns to a color...
3
by: Penny Bond | last post by:
Hi, Any help or suggestions on this one would be gratefully appreciated: I have 2 aspx pages one is called 'Query' and the other 'Details'. Query page has a number of text boxes and drop...
3
by: ANTISPAM_garycnew_ANTISPAM | last post by:
What is the simplest way to retain the last option value selected in an html select object using javascript? I am currently using a server-side cgi language to accomplish this task, but it adds...
4
by: Sarita Sai Bhushan | last post by:
Hi, While I was developing a active desktop web page in ASP.Net using server controls I faced a problem with the autopostback property of server control. The sever control I used in my aspx page...
3
by: newcomsas | last post by:
Hello. I'm trying to solve a problem related to JS and CSS. I produced an HTML page with several links and buttuns. I then created a CSS file in order to display a yellow background when a link...
15
by: pbd22 | last post by:
Hi. I want to create a tab with a little "active tab" arrow below it to tell the user where they are. An example is here: http://personals.yahoo.com/us/search/dashboard Does anybody know of...
1
beacon
by: beacon | last post by:
I'm looking to reset the visited link color once another link is selected. Also, once that link takes me to a particular page, I want the font-weight for that page to be bold to indicate that it's...
2
by: Garima12 | last post by:
There is htm page. In its body I am calling a class from stylesheet called TaskbarStyle(classname). Now I want to change the color of hyperlink in this page as well as their active link color. I am...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.