Click to See Complete Forum and Search --> : CSS & Hyperlinks


jester
01-04-2001, 11:52 PM
I need to create a web page that displays two different styles of hyperlinks. I'd imagine one would use CSS to do this. I can create one style of a hyperlink by doing the following:

a { text-decoration: none; color="#000000" }
a.l { color: #000000; text-decoration: none }
a.l2 { color: #000000; text-decoration: none }
a.m { color: #000000; text-decoration: none }
a:hover { color: #000000 }

but this lets me use one style for the whole page. How could I create a class that allows me to use two(or more) different styles?

------------------
- jeste®

How could tomorrow ever follow today?

kid A
01-05-2001, 10:30 AM
You have to actually name the class for each <a href> tag to make it work, like so:

Say you have two sets of links attributes:
a {text-decoration:underline;}
a.two {text-decortation :overline;}

All links will be underlined now.If you want the links to have overline you have to do it like this:

<a class=two href=http://bla.bla.bla>blabla</a>

Hope this helps.

------------------
Now listening to:
Røyksopp - Apple

[This message has been edited by kid A (edited January 05, 2001).]

jester
01-05-2001, 07:48 PM
Originally posted by kid A:
You have to actually name the class for each <a href> tag to make it work, like so:

Say you have two sets of links attributes:
a {text-decoration:underline;}
a.two {text-decortation http://www.sharkyforums.com/ubb/redface.gifverline;}

All links will be underlined now.If you want the links to have overline you have to do it like this:

<a class=two href=http://bla.bla.bla>blabla</a>

Hope this helps.




Hey, thanks! I've been trying all kinds of things to get that functionality to work. I was actually interested in the hover attribute which was

a:hover.two { color: #FFFFFF }

and it worked.

------------------
- jeste®

How could tomorrow ever follow today?

kid A
01-05-2001, 08:42 PM
Yeah I forgot to mention that, but it's the exact same thing (as you found out) http://www.sharkyforums.com/ubb/smile.gif

------------------
Now listening to:
Røyksopp - Apple

Pestilence
01-10-2001, 02:17 AM
I was trying to figure out how to do thisas I forgot, I'm glad I know how to do it again.

jester
01-10-2001, 05:13 AM
Originally posted by Pestilence:
I was trying to figure out how to do thisas I forgot, I'm glad I know how to do it again.

Its a nice feature. Lets you create a seperate file and import it into each web page that you have. That way all of your fonts are the same.

------------------
- jeste®

How could tomorrow ever follow today?

kid A
01-10-2001, 08:10 AM
Originally posted by jester:
Its a nice feature. Lets you create a seperate file and import it into each web page that you have. That way all of your fonts are the same.



You mean

<link rel=stylesheet href=../styles.css type=text/css>

?? - That's a really good feature. I started making separate style sheets for each page, but that's just a complete waste of time. Using the above method it great for getting the same styles on all pages. http://www.sharkyforums.com/ubb/wink.gif

------------------
Now listening to:
Røyksopp - Apple

[This message has been edited by kid A (edited January 10, 2001).]

jester
01-10-2001, 01:35 PM
Originally posted by kid A:
You mean

<link rel=stylesheet href=../styles.css type=text/css>

?? - That's a really good feature. I started making separate style sheets for each page, but that's just a complete waste of time. Using the above method it great for getting the same styles on all pages. http://www.sharkyforums.com/ubb/wink.gif



Thats the guy I was talking about. He's a life saver. Well, maybe not a life saver, but darn close to it.


------------------
- jeste®

How could tomorrow ever follow today?

GrayCalx
01-12-2001, 05:42 PM
I'm a little bit lazy... I just call all my pages .asp even style.asp then I just do a <!--#include ...-> at the top of all the pages that need to use style.asp. Even then you could name it .css, but whats the point?! http://www.sharkyforums.com/ubb/smile.gif

jester
01-12-2001, 07:01 PM
Originally posted by GrayCalx:
I'm a little bit lazy... I just call all my pages .asp even style.asp then I just do a <!--#include ...-> at the top of all the pages that need to use style.asp. Even then you could name it .css, but whats the point?! http://www.sharkyforums.com/ubb/smile.gif
It may not be a big deal, but the difference is in the output. In your #include statement, the actual source is put into the "View Source" output. When you use the method described in the previous posts, there is no source output. The only way a person can get the source is to actually put the exact URL into the address bar. But no biggie.



------------------
- jeste®

How could tomorrow ever follow today?