Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder
    Join Date
    Nov 2009
    Posts
    200
    Thanks
    23
    Thanked 0 Times in 0 Posts

    Remove Part of a Link Underline

    Hi,

    How can I remove the word Text underline using inline style?
    <a href="http://www.example.com/">Some Text</a>


    Thanks in advance!
    Rain Lover

  • #2
    Regular Coder
    Join Date
    Jan 2009
    Posts
    173
    Thanks
    5
    Thanked 12 Times in 11 Posts
    Split it into two different links and style the second one, like this:
    Code:
    <a href="http://www.example.com/">Some </a><a style="text-decoration: none;" href="....">Text</a>

  • #3
    Regular Coder Donkey's Avatar
    Join Date
    Sep 2003
    Location
    Blackfield UK
    Posts
    312
    Thanks
    1
    Thanked 36 Times in 36 Posts
    Code:
    <p><a href="http://www.example.com/">Some</a>Text</p>
    That will do it but you need to style the text in the containing element (I have used <p>) the same as the link.
    " 90% of everything is crud" - Theodore Sturgeon
    Filthy Beast - a 60's Rock Band

  • #4
    Regular Coder
    Join Date
    Nov 2009
    Posts
    200
    Thanks
    23
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by nikee View Post
    Split it into two different links and style the second one, like this:
    Code:
    <a href="http://www.example.com/">Some </a><a style="text-decoration: none;" href="....">Text</a>
    It has a little problem:
    When you hover your mouse over the first word it changes the color (link hover style), but the second word shows no color change and vice versa.

    Thanks anyway!

  • #5
    Regular Coder
    Join Date
    Nov 2009
    Posts
    200
    Thanks
    23
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Donkey View Post
    Code:
    <p><a href="http://www.example.com/">Some</a>Text</p>
    That will do it but you need to style the text in the containing element (I have used <p>) the same as the link.
    That way, the word Text won't be a link anymore.

  • #6
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,957
    Thanks
    9
    Thanked 727 Times in 721 Posts
    How about:

    Code:
    <a href="http://www.example.com/" style="text-decoration:none"><span style="text-decoration:underline">Some</span> Text</a>
    With the span removing the underline rather than adding it, FF at least leves everything underlined - this way seems to work.

    I'm moderately curious as to why you should need such an effect...

  • #7
    New Coder
    Join Date
    Jun 2010
    Posts
    22
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by SB65 View Post
    How about:

    Code:
    <a href="http://www.example.com/" style="text-decoration:none"><span style="text-decoration:underline">Some</span> Text</a>
    With the span removing the underline rather than adding it, FF at least leves everything underlined - this way seems to work.

    I'm moderately curious as to why you should need such an effect...
    That's exactly what I was going to suggest, I guess you beat me to it!

  • #8
    Regular Coder
    Join Date
    Aug 2005
    Location
    MS
    Posts
    850
    Thanks
    11
    Thanked 79 Times in 77 Posts
    Answered HERE.
    ☠ ☠RON☠ ☠

  • #9
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,957
    Thanks
    9
    Thanked 727 Times in 721 Posts
    Quote Originally Posted by Major Payne View Post
    Answered HERE.
    ..but answered here first.


  •  

    Posting Permissions

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