Forum Moderators: not2easy

Message Too Old, No Replies

Font Color Trickery?

Reassigning Font Colors

         

jwohlt

6:32 pm on Aug 22, 2006 (gmt 0)

10+ Year Member



I'm working with .NET pages where a style is generated on-the-fly within the <a> tag to designate the currently selected page in the menu. Since I've been asked to work solely with styles and not get into the actual programming, I'm forced to either find a workaround or else I'm stuck with the standard "Red" that is being applied to the current page link.

I've already assigned a class for the other link attributes, but there is an embedded style that is generated on-the-fly. Here's an example:

<a id="test" class="HyperLink" href="test.aspx" style="color:Red;text-decoration:none;">Link Text</a>

I'm just an intermediate..is there a trick available to assign a hex number to any occurrences of the color name "Red" in the page?

If there is, many thanks in advance...

Fotiman

10:20 pm on Aug 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




... a style is generated on-the-fly within the <a> tag to designate the currently selected page in the menu. Since I've been asked to work solely with styles and not get into the actual programming, I'm forced to either find a workaround or else I'm stuck with the standard "Red" that is being applied to the current page link.

I've already assigned a class for the other link attributes, but there is an embedded style that is generated on-the-fly. Here's an example:

<a id="test" class="HyperLink" href="test.aspx" style="color:Red;text-decoration:none;">Link Text</a>

So the style attribute is getting generated automatically by the code, right? And you want to override that style, right?


I'm just an intermediate..is there a trick available to assign a hex number to any occurrences of the color name "Red" in the page?

No. I'm thinking that if you want to override this generated style, you'll probably want to use some JavaScript to find and replace the style values. This is what happens when you (and I don't mean you in particular, since it sounds like you're picking up someone else's mess) relies on inline styles. In my opinion, they're worst than tag soup!

Sorry.

jwohlt

1:15 pm on Aug 23, 2006 (gmt 0)

10+ Year Member



Thanks for the tip, Fotiman...I didn't really consider javascript. I'll take a look at that.