SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2000
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simple yet not

    Ok I havea question which to many of you is probably a no-brainer, and should be for me too. Yet I can't figure it out. All I want to do is change the link color and bold it when I move the mouse over the link.

    I'm not sure how to bold it but this is what I did to change the link color

    <style type="text/css">
    <!--
    a:hover { color: #666666}
    -->
    </style>

    Now the problem I run into is the fact that it does this to all my links in the page. How do I make it only do it to the links I want it to?

  2. #2
    mouse monkey
    Join Date
    Dec 1999
    Location
    UK
    Posts
    656
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Firstly to make fonts bold when your mouse hovers over them you need to add "font-weight: bold" into your CSS class. So it would look something like:

    Code:
    <style type="text/css">
    <!-- 
    a:hover { color: #666666; font-weight: bold } 
    --> 
    </style>
    If you only want this too happen to some links on your site you need to make the CSS class into a named one from setting it as the page default like you do above. This is done with the following code:

    Code:
    <style type="text/css">
    <!-- 
    a.hoverlink:hover { color: #666666; font-weight: bold } 
    --> 
    </style>
    This will then only apply the hover affect to links with the class sepcified. So if you wanted a link that had the hover affect you would use

    Code:
    <a href="http://somepage.com" class="hoverlink">Link</a>
    Then for the links that you didn't want to have the hover affect you would just use a normal <a> tag (<a href="somepage.htm">Link</a>).

    Then if you want different links to have different affects you can just add another class into your style sheet.


    Hope that helps, sorry for the complicated explination but I only just got up .

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2000
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It worked! Thanks a lot!! I'm in the middle of redesigning our site and got totally stuck on this one.


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
  •