multiple <A> styles or classes or whatever

liunx

Guest
in my stylesheet, which i have cleverly named STYLESHEET.CSS, i have one little style specified for A elements:

A:link, A:visited, A:active
{ color: #000064; }
A:hover
{ color: #FF9900; }


unfortunately, no matter HOW i define my other styles, i cannot override these settings.

i've tried things like this:
stylesheet:
.Edit {
color: #FF0000;
}

and my link like this:
<A CLASS="Edit">nope, this doesn't work</a>


i've also tried this:
A.Edit:link, A:visited, A:active

that doesn't work either. anybody have some advice for me?How did you import the stylesheet into the page? Does any other CSS get applied?I'm guessing you're using Internet Explorer. Try adding HREF=http://www.webdeveloper.com/forum/archive/index.php/"#" to your anchor (hyperlink), and see if it works, then. The code should work fine.

[J]onasorry to be vague, but each A tag has a full-on URL as HREF (complete with GET vars appended). Here is an example tag:


<SPAN CLASS="PageElementEdit">[<A CLASS="Edit" HREF='http://www.webdeveloper.com/forum/archive/index.php/#' onClick="javascript:nw=window.open('edit_page_element.php?peid=pe40458d7b6693d','edit','height=500,width=500, location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=yes');nw.opener=self;return false;">EDIT</A>]Answer Fred's question--is all the other CSS working properly? Also, check to make sure you don't have any comments in the wrong place or invalid syntax (like typos) in there. If you have this online, it may help, otherwise you might want to upload the CSS file to this forum. I don't see anything wrong with the code you're using, though...

[J]onarats! i took some time to post my stylesheets and wrote a rather lengthy response but it somehow failed to post.

answer: YES the other stylesheet stuff works...just the link colors are causing trouble. I have two stylesheets that are applied to the page and only one has A tag stuff. the other has the 'Edit' class that i would like to use to override the original color. i have attached the two stylesheets and a sample link...i have exaggerated the size of the font to make sure that my stylesheet is taking.Use a.Edit instead of just .Edit.

[J]onaa.edit:link, a.edit:visited, a.edit:active {
color: #F00;
}

Try that.

You might want to try validating your CSS. If you have Firefox/Firebird, check out the Web Developer toolbar. Under "Validation," you can choose "Validate Local CSS."
NEvermind, you can do it here: <!-- m --><a class="postlink" href="http://jigsaw.w3.org/css-validator/validator-upload.htmlthis">http://jigsaw.w3.org/css-validator/vali ... d.htmlthis</a><!-- m --> worked:


a.edit:link, a.edit:visited, a.edit:active {
color: #F00;
}


and that w3c link is awesome! you guys rock.
 
Back
Top