View Full Version : Span of text with a background color not underlined when part of a link

12-13-2010, 04:30 PM
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.

#search-results a {
text-decoration: underline;

.search-term {
background-color: yellow;

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

12-13-2010, 04:35 PM
#search-results a, #search-results a span {
text-decoration: underline;
} ?

12-13-2010, 04:51 PM
You rock! I was drawing a blank, thanks so much!