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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jan 2005
    Posts
    140
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Span of text with a background color not underlined when part of a link

    If this has been covered before I apologize.

    I want the search-term span to be underlined since it is part of a link but not underlined when it isn't part of a link.

    PHP Code:
    #search-results a {
    text-decorationunderline;
    }

    .
    search-term {
    background-coloryellow;
    }

    <
    div id="search-results">
        <
    p><a href="#"><span class="search-term">Lorem</spanipsum</a><br />
    Donec iaculisurna et gravida lacinianunc turpis cursus <span class="search-term">lorem</span>, sit amet hendrerit odio dui eget dolor.</p>
    </
    div

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Code:
    #search-results a, #search-results a span {
    text-decoration: underline;
    }
    ?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Regular Coder
    Join Date
    Jan 2005
    Posts
    140
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You rock! I was drawing a blank, thanks so much!


  •  

    Posting Permissions

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