/    Sign up×
Community /Pin to ProfileBookmark

multiple <A> styles or classes or whatever

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?

to post a comment
CSS

8 Comments(s)

Copy linkTweet thisAlerts:
@fredmvMar 26.2004 — How did you import the stylesheet into the page? Does any other CSS get applied?
Copy linkTweet thisAlerts:
@JonaMar 26.2004 — [font=arial]I'm guessing you're using Internet Explorer. Try adding HREF="#" to your anchor (hyperlink), and see if it works, then. The code should work fine.[/font]

[b][J]ona[/b]
Copy linkTweet thisAlerts:
@sneakyimpauthorMar 26.2004 — sorry to be vague, but each A tag has a full-on URL as HREF (complete with GET vars appended). Here is an example tag:

[code=php]
<SPAN CLASS="PageElementEdit">[<A CLASS="Edit" HREF='#' 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>][/code]
Copy linkTweet thisAlerts:
@JonaMar 26.2004 — [font=arial]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...[/font]

[b][J]ona[/b]
Copy linkTweet thisAlerts:
@sneakyimpauthorMar 26.2004 — rats! 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.

[upl-file uuid=b3974552-f386-48e6-b16b-b14458eec809 size=2kB]woop_here_it_is.zip[/upl-file]
Copy linkTweet thisAlerts:
@JonaMar 26.2004 — [font=arial]Use a.Edit instead of just .Edit.[/font]

[b][J]ona[/b]
Copy linkTweet thisAlerts:
@scottOMar 26.2004 — a.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: http://jigsaw.w3.org/css-validator/validator-upload.html
Copy linkTweet thisAlerts:
@sneakyimpauthorMar 26.2004 — this worked:

[code=php]
a.edit:link, a.edit:visited, a.edit:active {
color: #F00;
} [/code]



and that w3c link is awesome! you guys rock.
×

Success!

Help @sneakyimp spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...