SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Mar 2003
    Location
    london
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    2 css on the same page

    Hi,
    I've already got my CSS for my website, links,hover,active, visited state.

    I'd like to have another CSS for links, hover, active and visited state within the same page, (I want some links to look different on the page)how do I go about this?

    I know it's going to be a class, but can someone show me the way to write it pls...
    Thanks.

  2. #2
    SitePoint Zealot martin's Avatar
    Join Date
    Jun 2001
    Location
    London
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you could put the links in a new div like this:
    Code:
    <div id="newlinks">
      <a href="#">a link</a>
    </div>
    and then in your css add the following rules:
    Code:
     #newlinks a {
    color: #333;
    }
    
    #newlinks a:hover {
      color: #999;
      decoration: none;
    }
    this should work, or as you say add a class, but this is far quicker as you dont need to add the class to each link!

    Hope this helps
    Martin

  3. #3
    SitePoint Addict Shalin's Avatar
    Join Date
    Sep 2003
    Location
    __beyond
    Posts
    295
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes its possible to use two different styles for links. I guess you know how to specify style tag:
    E.g.

    a.:link
    {
    color: rgb(51,153,255);
    }
    a:visited
    {
    color: rgb(51,102,204);
    }
    a:active
    {
    color: rgb(255,153,0);
    }

    you can make more style class this way:

    a.type1.:link
    {
    color: rgb(51,153,255);
    }
    a.type1:visited
    {
    color: rgb(51,102,204);
    }
    a.type1:active
    {
    color: rgb(255,153,0);
    }

    you can call the style type1 in this manner:

    <a class="type1" href="yourlinl...."

    Hope this helps.

    Cheers,
    Shalin

    See also: http://www.sitepointforums.com/showt...hreadid=129046
    Help Desk Software - Helpdesk Pilot
    Flash Screensaver - Screenswift for Windows
    Online Polls - Tezaa.com
    Address Book Software - Addza for Windows

  4. #4
    SitePoint Addict
    Join Date
    Mar 2003
    Location
    london
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the responses!


Bookmarks

Posting Permissions

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