473,770 Members | 4,419 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 20227
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.forum4de signers.com>,
crhaynes <cr************ *@mail.forum4de signers.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.forum4de signers.com> wrote in message
news:cr******** *****@mail.foru m4designers.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
4196
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 code will insert a visual indicator (e.g. *) to convey that the field must be filled in. However, if the user has made a selection in the pulldown list and has left an INPUT field empty, when the form reappears after validation, the pulldown menu...
6
15900
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 a, then when I click/mouseover over the link 2, it turns to a color b and the link 1 turns to the normal link color again. (an so with the other links). Is this possible with CSS?
3
2409
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 down's for parameter selection, a 'Search' button and a grid that displays the results (the results contain links to 'Details' page with query string params). The 'Details' Page allows user to see detailed information on the selected product.
3
3346
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 a lot of overhead and I would like to move the overhead to the remote client's PC, using javascript. Thank you for your assistance. Respectfully,
4
2358
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 is a dropdown box. After deploying the page as a active desktop page whenever the selected index of the dropdown box changes an autopopstback takes place and a new browser window opens. But when the "autopost back" was replaced by the...
3
2215
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 is clicked by users. UL.menu1 LI A:active{ BACKGROUND: yellow; COLOR: black Naturally, having acted on the A:active property, when a link is
15
8953
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 any examples out there on how to do this? Thanks!
1
4116
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 the page you're looking at. Now, if the links have never been visited before, they are blue. If you hover over the links they turn light blue. I want the user to be able to select the link and it take you to that page. On that page, I want the link...
2
2617
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 calling 2 stylesheets on this htm page. code of htm page: <BODY class="TaskbarStyle" TEXT="Black" bottommargin="0" centermargin="0" rightmargin="0" topmargin="0"> code of stylsheet which contains TaskbarStyle class; .TaskbarStyle { ...
0
9602
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9439
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10237
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10071
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8905
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3987
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2832
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.