Click to See Complete Forum and Search --> : a:active will just not work-please help


madmanbean
08-04-2006, 12:35 PM
Having real problems with this style sheet I think all is in the right order but cannot get the a:active component to work. a;hover works fine..
full css code below

body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
font-family: Tahoma, Helvetica, sans-serif;
font-size: 9pt;
color: #666666;
}
table {
font-family: Tahoma, Helvetica, sans-serif;
font-size: 9pt;
color: #666666;
}

.border {
border: #FFFFFF;
}
.menu {
font-family: Tahoma, Arial, Haettenschweiler, Crandall;
font-size: 9pt;
font-weight: normal;
color: #FFFFFF;
}
h1 {
font-size: 14px;
color: #9E0B0E;
}

h2 {
font-size: 12px;
color: #9E0B0E;
}

h3 {
font-size: 12px;
color: #FFFFFF;
}
h4 {
font-size: 12px;
font-weight: normal;
color: #FFFFFF;
}

a:link {
color: #FFFFFF;
text-decoration: none;
}

a:visited {
color: #FFFFFF;
text-decoration: none;
}

a:hover {
color: #9E0B0E;
text-decoration: none;
}
a:active {
color: #9E0B0E;
text-decoration: none;
}
.style1 {
color: #FFFFFF;
}

the website this is linking to is www.hiverealestate.com (work under way) any ideas how to make the link to the active page work much appreciated..I have given up searching for a solution!
Thankyou all those wiser than me

WebJoel
08-04-2006, 12:59 PM
It works...

a:hover {
color: #9E0B0E;
text-decoration: none;
}
a:active {
color: #9E0B0E;
text-decoration: none;
}

but these are THE SAME THING. :)

Change the color of one, the font-size of one, the font-family of one of these, or the font-weight:bold;, text-decoration:underline; letter-spacing:0.1em; ...-do something "different"... it will work for you. What you have, is working. It's just exactly the same thing...

madmanbean
08-04-2006, 01:57 PM
err no??
Surely..a:hover works when the mouse is over a hyperlink but the actual page you are on should remain with that link highlighted in the mouseover colour!

Or an I missing something?

a rival site has this working and we want to copy it!!

see www.gatewayproperties.co.uk

Kravvitz
08-04-2006, 04:08 PM
No, active means when the link is being activated, not when the link points to the current page.

madmanbean
08-04-2006, 05:03 PM
I wondered about that so how is it that the site I mentioned in my previous post works?? Seems there are two schools of thought re this
1)a:active means the page that is loading and
2)a:active the page that was last clicked!

see http://www.gatewayproperties.co.uk/index.html This site seems to have the current page hyperlink showing in a different colour but cannot work out just which bit of the css relates to the different colour! :confused:

Kravvitz
08-04-2006, 05:15 PM
That page uses the "submenuheader1" class for the current link and "submenuheader" for the others.

Don't copy its HTML code -- it's horrific.

madmanbean
08-04-2006, 05:20 PM
am getting there but they have at least achieved what I want to do!
So..what should be the correct css to create the effect of having the "active link highlighted in a different colour? I would normally simply remove the link for the page that is being viewed but there are being changes to thos site three or four times a day at the moment so to do so is a lot of work. Hence the template!

Kravvitz
08-04-2006, 05:27 PM
*shrugs* There's more than one way to do that. The most common is to give a special class to the current link, like that site did. Make sure that the rule for that class has high enough specificity (http://www.w3.org/TR/CSS21/cascade.html#specificity).

madmanbean
08-06-2006, 04:36 AM
please help..losing spleep here

nightster
08-06-2006, 05:30 AM
I don't know much about css (yet) but I *think* this needs to be done using a scripting language, like php for example. You need to change the class given to the "active" link (i.e. the link for the page the user is on) dynamically. I don't *think* this can be done in css alone. Anyone correct me??

Kravvitz
08-07-2006, 12:23 AM
Correct, you can't do this with CSS alone.

A hook of some kind, often a class, must be placed in the X/HTML, either statically, via a servers-side language, or via (client-side) JavaScript.

Keep in mind that some Internet users use a browser that doesn't have JavaScript enabled. (http://www.thecounter.com/stats/2006/July/javas.php)