Results 1 to 6 of 6

Thread: CSS - Links

  1. #1

    Thread Starter
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765

    CSS - Links

    Whats the code to set a links Color, vcolor and Hover color??

    I can't get it going
    Don't Rate my posts.

  2. #2
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    Code:
    a:link {
    }
    a:visited {
    }
    a:hover {
    }
    html>body a:focus {
    }
    html>body a:hover:focus {
    }
    a:active {
    }
    html>body a:hover:active {
    }
    The ones with html>body before them are ones that don't work in IE properly, but do in Mozilla. You can take out whatever ones you like, but try to leave them in the order above, otherwise you probably won't get the effect you're looking for (e.g. hover won't work).

    To set the colour do something like this:

    Code:
    a:link {
      background:transparent;
      color:#ff00ff;
    }

  3. #3

    Thread Starter
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765
    What should I use for a certain number of links??

    As I have my menu at the top of my page which is dark, so I've choosen a light link color(white), but the parts where there is text, has a black background, so I'm having to font="Blue" to make the links visible.
    Don't Rate my posts.

  4. #4
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    Well there are several things you can do. First is use classes:

    Code:
    a.menu {
      background:black;
      color:white;
    }
    
    <a href="#" class="menu">Blah blah</a>
    Second and probably better way in this case is use ID for the container the links are in:

    Code:
    #menu a {
      background:black;
      color:white;
    }
    
    <div id="menu">
      <a href="#">Blah blah</a>
    </div>
    You could also do that with a class:

    Code:
    .menu a {
      background:black;
      color:white;
    }
    
    <div class="menu">
      <a href="#">Blah blah</a>
    </div>

    There are loads of alternatives on that too.

  5. #5

    Thread Starter
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765
    How do I do the Hover color??

    I tried hover:red
    but it didn't work

    I'm totaly new to CSS, apart from the user of the Hover Tag of course.
    Don't Rate my posts.

  6. #6
    Lively Member
    Join Date
    Jul 2002
    Location
    Gateshead, UK
    Posts
    101

    Hover

    a:hover {color:red;} should work.
    <% Session("OwNeD")=True %><html><body>Blah... <%="Now get your ass back to the twilight zone..."%></body></html>

Posting Permissions

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



Click Here to Expand Forum to Full Width