Click to See Complete Forum and Search --> : CSS newbie question on multiple styles


waizen
03-05-2003, 11:04 AM
No doubt this is a very basic question, but how do you go about creating multiple styles (different styles) for links within the same page? For instance, if you go to
www.cnn.com, you can see that they created different links with different ways of doing the rollovers. Some have blue text, rolling over to red with no underline, while others start as white text, rolling over to another color, etc.

Then, how do you go about assigning these values on the web page itself? Did they use multiple css pages? Or are all the values on a single one somewhere?

Thank you in advance.

Stefan
03-05-2003, 11:08 AM
This has been answered at least 2 times the 3 last days, and probably about 20 times the last 2 months.

Please use search. :)

waizen
03-05-2003, 07:37 PM
Been there, tried that, but no doubt I'm not using the right keywords or something because all the returns I get have to do with javaScrip. I need to know how to do this in css.

Sorry if this topic has been covered many times by other newbies like me, but I do need to know the answer. Can you at least point me to the right post that already covered the subject?

Again, thanks in advance.

khaki
03-05-2003, 08:19 PM
hi willi...

the exact style sheet that CNN uses for that site is here:

http://i.cnn.net/cnn/.element/ssi/css/1.0/main.css

maybe that will help you connect all of the dots. respond back if you are still having trouble.
k

(stefan, why do you even respond if you are not going to help? i know that you find it tiresome answering many of the same questions over and over, but we've had this dicussion before, and no one is forcing you to respond at all. i really wish you wouldn't make people feel bad for asking questions. waizen has 7 posts on these boards. you have 986. do you really expect everybody to be as savy as you after only 7 posts? please try to be more positive. as a favor to me, at least? k)

tonis
03-06-2003, 12:57 PM
Create classes and id's and implement them when you want different styled links



ie
<a class="style1" href="blah.htm">blah</a>
<a class="style2" href="blah.htm">blah</a>

same link but can look totally different

tonis
03-06-2003, 12:58 PM
HTML Goodies has a great tutorial on creating classes and ID's

nkaisare
03-06-2003, 01:37 PM
If you use HTML goodies tutorials, make sure you validate your pages later using http://validator.w3.org
Some of the errors that the validator displays may be non-intuitive. But soon you'll learn.

CrazyGaz
03-14-2003, 05:26 PM
this should work.


<head>
<STYLE TYPE="text/css"><!--
a.red:link {text-decoration: none; color=#ff0000}
a.red:hover{text-decoration: underline; color="#ff0000"}
a.green:link {text-decoration: none; color=#00ff00}
a.green:hover {text-decoration: underline; color=#ffffff}
-->
</STYLE>
</head>
<body>
<a href=http://dsfdaf.com class=red>test1</a>
<a href=http://dgdsgsdg.com class=green>test2</a>
</body>


hope that was what you were after.