Forum Moderators: not2easy

Message Too Old, No Replies

a:link question

         

Blelisa

3:40 pm on Mar 19, 2004 (gmt 0)

10+ Year Member



Hi,
I have two forms of links on my page. I want my first group to have a certain set of rules (color, size, stc.) and my second group of links to have a different set of rules. I am using an external style sheet. I know one will be set as
a:link: ****x;
a:visited: xxx;
a:active: xxx;

But how do I set another class for my other links?
Is it this the way to do it?

a.two:link: xxx;
a.two:visited: xxx;
a.two:active: xxx;

Than in my code = <a href class="two"="http.//...>
This doesnt seem right too me, any thoughts?
Thanks!

grahamstewart

3:44 pm on Mar 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The CSS is right but the HTML should be..

<a class="two" href="link1.html">link one</a>

benihana

3:46 pm on Mar 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yep that should do it.

alternatively if the class 'two' of links are all in one place you maybe able to wrap them all in a span, div or td:

<span class="two"><a href="...</span>

and have your css like so:

.two a:link,
.two a:visited {

styles
}

<edit> too slow - and didnt spot the error. so another useless post from me. yay! ;)</edit>

[edited by: benihana at 3:52 pm (utc) on Mar. 19, 2004]

Blelisa

3:50 pm on Mar 19, 2004 (gmt 0)

10+ Year Member



Thanks! Thats just what I needed!

bruhaha

4:52 pm on Mar 19, 2004 (gmt 0)

10+ Year Member



alternatively if the class 'two' of links are all in one place. . . .

I would ordinarily code it the second way, for the reason mentioned. (In fact, I was in the midst of writing much the same response... just a bit too slow!)

But now I'm curious --are there situations in which "a.two:link" is to be preferred?

grahamstewart

5:01 pm on Mar 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If it is a group of links then some variation on the second way makes more sense. e.g.

<div class="two">
<a href="#">one</a>
<a href="#">two</a>
<a href="#">three</a>
</div>

..but if the links are used inline with other text then the first way might make more sense (especially if there are other links that are not styled that way - e.g. one style for internal and one style for external).

Blelisa

6:02 pm on Mar 19, 2004 (gmt 0)

10+ Year Member



One group of links is for my tiny menu bar at the bottom of the page, I want those links a certain color, and decoration, the second group is for my links at the top of the page that I want completely different than my bottom links.
I will probably go with the span process