Click to See Complete Forum and Search --> : Changing Font Color


chestertb
12-23-2003, 10:08 PM
Hi,

Have run into a bit of a wall with changing font colours.

My font sttributes are set using CSS as follows;

A:link {
color: #948578;
background-color: #FFFFFF;
text-decoration: none;
font-weight: bold;
}

A:visited {
color: #948578;
background-color: #FFFFFF;
text-decoration: none;
font-weight: bold;
}

A:hover {
color:#2C5163;
background-color:#FFFFFF;
text-decoration:none;
font-weight: bold;
}
A:active {
color: #2C5163;
background-color:#FFFFFF;
text-decoration:none;
font-weight: bold;
}

The HTML that contains those links is as follows;

<a href="JavaScript:getit(3,1)">The US$6.90<br />
Economy Plan</a><br />
<br />
<a href="JavaScript:getit(3,2)">The US$9.90<br />
Deluxe Plan</a><br />
<br />
<a href="JavaScript:getit(3,3)">The US$16.90<br />
Luxury Plan</a><br />
<br />
<a href="JavaScript:getit(3,4)">Take This One<br />
To The Checkout</a><br />

It works just fine... in that the font colour for the active link is set on click without javascript. However, when the page first loads, I default the selection to the first option.

Can I tell the browser to treat the first link as active? If not, any suggestions on how can I change the font colour for the first option to the "active" colour, and then have it revert to the CSS when another option is selected?

Thanks
CTB
Note... I have posted a version of this under CSS as well... perhaps that's a better way to achieve the desired result.

ray326
12-24-2003, 12:07 AM
When you hit little speed bumps like this sometimes it's because the design has problems. You seem to be using anchors to do the job of a radio button set. You might want to redesign your page using radio buttons for that plan selection use case.

chestertb
12-24-2003, 06:08 PM
Thanks for that. I thought of radio buttons, but didn't like the look... they don't suit the visual feel of the site.

I think maybe I'm just trying to be a bit too economical with code, and that the solution might be more complex.

FYI, the original version has the selections as two images, one "normal" and one "selected", and the highlighted one was show by using "clip".

Doing it this way reduced bandwidth consumption and speeds up the page, but I think I'll step back from it and re-engineer in the new year.