lolalola
lolalola

Reputation: 3823

html + css text-decoration

Below is the code in which I tried using text-decoration:none. However, text is always underlined.

<html>
    <head>
    <style type="text/css">
    .search, .search_b1, .search_b2{
     display: block;
     color: #000;
     text-decoration: none;
    }
    .search_b1:hover {
     color: red;
    }
    </style>
    </head>
    <body>
    <div id="left"> 
     <a href = "#">
      <span class="search"> 
       <span class="search_b1">Text text</span> 
       <span class="search_b2">Text text</span> 
      </span> 
     </a>
    </div>
    </body>
    </html>

Upvotes: 1

Views: 229

Answers (2)

rcravens
rcravens

Reputation: 8390

You need to apply the text-decoration to the anchor elements.

Upvotes: 2

janhartmann
janhartmann

Reputation: 15003

You set the span element to a block element.

Block elements can not have text-decoration. Only inline elements can.

Upvotes: 2

Related Questions