www.webdeveloper.com
Results 1 to 8 of 8

Thread: CSS newbie question on multiple styles

  1. #1
    Join Date
    Jan 2003
    Posts
    14

    CSS newbie question on multiple styles

    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.
    Willi Waizenegger
    Computer Graphics & Animation
    Portfolio at: www.williw.com

  2. #2
    Join Date
    Nov 2002
    Posts
    984
    This has been answered at least 2 times the 3 last days, and probably about 20 times the last 2 months.

    Please use search.
    // Stefan Huszics

  3. #3
    Join Date
    Jan 2003
    Posts
    14

    CSS newbie question on multiple styles

    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.
    Willi Waizenegger
    Computer Graphics & Animation
    Portfolio at: www.williw.com

  4. #4
    Join Date
    Jan 2003
    Location
    Jersey Girl
    Posts
    1,198
    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)

  5. #5
    Join Date
    Feb 2003
    Location
    wilmington
    Posts
    17
    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
    Tony

  6. #6
    Join Date
    Feb 2003
    Location
    wilmington
    Posts
    17
    HTML Goodies has a great tutorial on creating classes and ID's
    Tony

  7. #7
    Join Date
    Jan 2003
    Location
    Atlanta, GA
    Posts
    571
    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.

  8. #8
    Join Date
    Feb 2003
    Posts
    98
    this should work.

    Code:
    <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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles