473,378 Members | 1,512 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,378 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 20203
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...
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.