View Full Version : Question with CSS link styles...

01-07-2003, 08:58 AM
My current style sheet makes all links the same style...is there any way to make two seperate styles for links? And how would I implement them?

<a href="someURL">Hello</a>

would it be...

<a href="someURL" style=XXXX>Hello</a>


I'm lost:(

01-07-2003, 09:40 AM

definitely; you can use the style attribute to add a style to one specific link, or use any of the selector mechanisms available in CSS to assign styles to a certain group of links.

An example using a class selector:

a.mylink {color: black; text-decoration: none}

in the style sheet and

<a class="mylink" href="foo.htm">Foo</a>

in the page will show this link, and in fact all links using this class, in black without underlining.

An example using an inline style for one specific link:

<a style="color: red" href="bar.htm">Bar</a>

will show this one link in red.

01-07-2003, 09:42 AM
By the way, wrong forum again... :rolleyes:

01-07-2003, 10:44 AM
ooooo sorry bout that, didn't see the other forums :D

Thanks for your help, that will assist me greatly!