text undelined when mouse over it

Discussion in 'CSS' started by abracadabra, Mar 24, 2006.

  1. #1
    how to get the the text underlined when i place ony my mouse cursor on it and that clicking leading to an opening of a new window

    xample

    (1)text1...............(2)text1

    when the mouse is placed over (1) should look like (2) when i keep the mouse on top of the text and preferbly with a diiferent color and the underline style.
     
    abracadabra, Mar 24, 2006 IP
  2. superclick

    superclick Peon

    Messages:
    369
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Do it with CSS
    a{text-decoration: none;}

    a:hover {text-decoration: underline;}
     
    superclick, Mar 24, 2006 IP
  3. adamjthompson

    adamjthompson Well-Known Member

    Messages:
    1,242
    Likes Received:
    59
    Best Answers:
    0
    Trophy Points:
    125
    #3
     <style>
    <!--
    A:active { color:#000000; text-decoration; }
    A:hover { color:#000066; text-decoration: none; }
    //-->
    </style>
    Code (markup):
     
    adamjthompson, Mar 24, 2006 IP
  4. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #4
    
    <a href="some.html" onclick="return ! window.open(this.href);">go somewhere</a>
    Code (markup):
    This is fairly safe. If the user does not have javascript enabled, the link will simply open the page in the existing window. If the javascript fails to open a new window, the link fires normally and the page opens in the existing window. If javascript is successful, the page opens in a new window, and the link does not fire.

    Further, since the target attribute is deprecated, this is a valid method.

    cheers,

    gary
     
    kk5st, Mar 24, 2006 IP
  5. abracadabra

    abracadabra Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thnx ppl 4 u r support
     
    abracadabra, Mar 25, 2006 IP
  6. 87654321

    87654321 Well-Known Member

    Messages:
    317
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    110
    #6
    does the a:hover work in IE?
     
    87654321, Mar 29, 2006 IP
  7. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #7
    Yes.

    cheers,

    gary
     
    kk5st, Mar 30, 2006 IP
  8. 87654321

    87654321 Well-Known Member

    Messages:
    317
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    110
    #8
    does the :hover work for all tags in IE, because if so there would be no need for javascripts for dropdown menus right?
     
    87654321, Mar 30, 2006 IP
  9. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #9
    No, IE supports :hover only on the a element. IE7 will spread some love, but don't expect much IE7 penetration for quite a while.

    cheers,

    gary
     
    kk5st, Mar 30, 2006 IP