Log in

View Full Version : Link not staying the right color



9911782
09-13-2007, 10:59 AM
Good Afternoon

I really hope that someone can help me please.

I am trying to make my navigation list so that when a link is click, that link stays a certain color until you go and click another link

I have tried all the different CCS I know to make that, it is not accepting the color change, I think some other style is taking it over but have tried getting rid of or changing them to no avail. here is the css code in dreamweaver:

body {
font-family: Arial;
color:#ffffff;
font-size:11px;
}

td {
font-family: Arial;
color:#ffffff;
}
.copy {
font-family: Arial;
color:#000066;
}
h1 {
font-family: Arial;
color:#ffffff;
font-size:20px;
font-weight:bold;
margin-top:10px;
}
h2 {
font-family: Arial;
color:#000066;
font-size:18px;
font-weight:bold;
margin-top:10px;
margin-bottom:10px;

}
h3 {
font-family: Arial;
color:#ffffff;
font-size:14px;
font-weight:bold;
margin-top:0px;
margin-bottom:0px;
}

a.link:link {font-family: Arial;
color:#ffffff;
text-decoration:none;
font-weight:bold; }
a.link:visited {font-family: Arial;
color:#ffffff;
text-decoration:none;
font-weight:bold; }
#activelink a:active {
font-family: Arial;
color:#FF9900;
text-decoration:none;
font-weight:bold;
}
input
{
color:#ffffff;
border: 1px solid #FFffff;
background-color:#000066;
}
input.button
{
width: 70px;height: 24px;
color:#ffffff;
border: 1px solid #FFffff;
background-color:#000066;
cursor:hand;
}
#popup
{
position:absolute;
left:225px;
top:80px;
}
div.overflow {
padding-left:0px;
padding-right:0px;
padding-top:0px;
padding-bottom:0px;
width: 100%;
height: 380px;
overflow-x: hidden;
overflow: auto;
scrollbar-arrow-color:#ffffff;
scrollbar-face-color:#000066;
scrollbar-highlight-color:#ffffff;
scrollbar-shadow-color: #FFFFff;
scrollbar-track-color:#ffffff;
scrollbar-3dlight-color:#FFFFff;
scrollbar-darkshadow-Color: #FFFFff;
}
.borders
{
border-right:1px solid #000000;
border-bottom:1px solid #000000;
border-top:1px solid #000000;
color:#000066;
}

Thank you for ur help.

boogyman
09-13-2007, 01:21 PM
can you give us the link to the site? so we can look at any other code that may be inhibiting

djr33
09-13-2007, 01:46 PM
Wouldn't this need javascript?

<a href="" onclick="changeit(this);">

function changeit(link) {
link.properties = newstuff;
global oldlink.properties = regularstuff;
global oldlink = link;
}

Rough concept.

9911782
09-13-2007, 02:47 PM
can you give us the link to the site? so we can look at any other code that may be inhibiting


Thank you for your reply.My site if not live...hence i put all my coding with all files linked to it.

9911782
09-13-2007, 02:50 PM
I tried to put this within the <a href="" onclick="document.bgcolor='#FF9900';"

wanted to whats going to happen...but nothing is happening.

9911782
09-13-2007, 02:51 PM
why this in CSS not working?

a:active{
display:block;
font-family: Arial;
color:#FF9900;
text-decoration:none;
font-weight:bold;
background-color:#000066;
}

a:focus{

font-family: Arial;
color:#FF9900;
text-decoration:none;
font-weight:bold;
background-color:#000066;
}

boogyman
09-13-2007, 03:16 PM
1) are you travelling between pages when you click on a link? eg. does the link take you to a different page?
in this case you do not even need javascript at all... you just need to add a class that would provide a distinction between the link from the page in use and the rest of the possible choices


<a href="somelink">SOME LINK</a>
<a href="thelink" class="selectedLnk">CURRENT LINK</a>
<a href="somelink">SOME LINK</a>
<a href="somelink">SOME LINK</a>
<a href="somelink">SOME LINK</a>

and just change the class on whatever link is the page currently being viewed

2) if you're using the anchor tag to redirect you to a differnt part of the page (eg [jump to Top of page] ) on here is an example then you could try something like


<a href="#some_reference" onclick="this.style='background-color: #f90'">


the above could also be used in what I am assuming is your situation were you are incorporating some type of frame system :? where you click on a link and it populates the new page into a frame / iframe located somewhere on the page.

djr33
09-13-2007, 04:22 PM
Trouble/complexity with that is still that the old link would need to be changed to the inactive color.