/    Sign up×
Community /Pin to ProfileBookmark

Simple class question…

I have a class for th footer BUT I want to define a certin style for all the links I’ll have under this class. Here’s what I got so far:

#footer {color: #845746; font: 10px tahoma; text-align: center; padding: 6px 0 20px 37px;}
a.footer:link {text-decoration: none; color: #fff;}
a.footer:visited {text-decoration: none; color: #fff;}
a.footer:hover {text-decoration: underline; color: #fff;}

For some reason, it doesn’t work. Did I miss something?

Thanks!

to post a comment
CSS

5 Comments(s)

Copy linkTweet thisAlerts:
@David_HarrisonApr 22.2005 — Well, to reference a class you use a . so this rule:#footer { ... }Should be this:.footer { ... }And if your links are INSIDE the element with the class of footer then they should be referenced like this:.footer a { ... }
.footer a:link { ... }
.footer a:visited { ... }
.footer a:focus { ... }
.footer a:hover { ... }
.footer a:active { ... }
Copy linkTweet thisAlerts:
@weeeauthorApr 23.2005 — A few questions...

What's the focus is for?

And I want to use # insted of class it's ok?

Thanks man!
Copy linkTweet thisAlerts:
@David_HarrisonApr 23.2005 — 

# is for [url=http://www.w3.org/TR/CSS1#class-as-selector]referencing ID's[/url] and . is for [url=http://www.w3.org/TR/CSS1#class-as-selector]referencing classes[/url]. If you wanted to use id="footer" then you would reference it with #footer.



Links have focus when they are selected but not being activeted, for example, if you were to tab to a link, if would have focus. [url=http://www.w3.org/TR/CSS21/selector.html#dynamic-pseudo-classes]More on focus, hover and active.[/url]

It's all in the W3C specs.
Copy linkTweet thisAlerts:
@weeeauthorApr 23.2005 — Thank you David!
Copy linkTweet thisAlerts:
@David_HarrisonApr 23.2005 — Happy to help. ?
×

Success!

Help @weee 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.9,
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,
)...