Forum Moderators: not2easy

Message Too Old, No Replies

Two Link Styles on the Same Page

         

jk3210

7:12 pm on Sep 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm trying to get two different styles of links on the same page --one normal link style (blue) and one nav link style (white).

Anyone know why this isn't working:

<STYLE TYPE-"type/css">
A:link {color: blue; text-decoration: underline}
A:visited {color: blue; text-decoration: underline}
A:active {color: blue; text-decoration: underline}
A:hover {background: #6699cc; color: white; text-decoration: none}

A:nav:link {color: white; text-decoration: none}
A:nav:visited {color: white; text-decoration: none}
A:nav:active {background: #6699cc; color: white; text-decoration: none}
A:nav:hover {background: #6699cc; color: white; text-decoration: none}
</STYLE>

Thanks

RammsteinNicCage

7:22 pm on Sep 28, 2003 (gmt 0)

10+ Year Member



I see two problems:

1) I believe it should be <style type="text/css">, not <style type-"type/css">

2) Change

A:nav:link {color: white; text-decoration: none}
A:nav:visited {color: white; text-decoration: none}
A:nav:active {background: #6699cc; color: white; text-decoration: none}
A:nav:hover {background: #6699cc; color: white; text-decoration: none}

to

.nav a:link {color: white; text-decoration: none}
.nav a:visited {color: white; text-decoration: none}
.nav a:active {background: #6699cc; color: white; text-decoration: none}
.nav a:hover {background: #6699cc; color: white; text-decoration: none}

Jennifer

SuzyUK

7:32 pm on Sep 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well spotted on the first one Jennifer.. :)

the second one though will depend on how the links are specified in the HTML

.nav a:link {color: white; text-decoration: none}

will only work if the links are laid out so:
<div class="nav">
<a href="#">link text</a>
<a href="#">link text</a>
...
</div>

(note it needn't be a div but it has to a wrapper element that has the class name attached)

it may be that it needs to be changed to:
a.nav:link {color: white; text-decoration: none}

i.e. replace the first colon with a full stop(period?).
which will work when links are laid out:

<a class="nav" href="#">link text</a>

Suzy

RammsteinNicCage

7:36 pm on Sep 28, 2003 (gmt 0)

10+ Year Member



Ah, thank you Suzy! Perhaps I should stop wrapping everything so that I can see the different ways to do things. ;)

Jennifer

jk3210

8:01 pm on Sep 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It works!

Thanks to all.

Once again, I am at peace with the world.

(css-wise, anyway...)