2

Can we Disable underline of inside span element of underlined anchor tag. If it is possible please tell me how?

 <a>hello<span>praveen</span</a>

 <style type="text/css>
     a{
        text-decoration:underline;
     }
     a span{
        text-decoration:none;
     }
 </style>
ianaya89
  • 4,153
  • 3
  • 26
  • 34
Praveen Rawat
  • 724
  • 2
  • 12
  • 29
  • 1
    You cannot make with your current HTML structure. Try this http://jsfiddle.net/shanidkv/4oqyx6Le/ – shanidkv Jan 14 '15 at 05:36

2 Answers2

6

Try this.

add display: inline-block; for span style

a {
    text-decoration:underline;
}

a span {
    text-decoration:none;
    display: inline-block;
}

http://jsfiddle.net/4oqyx6Le/2/

Mansoorkhan Cherupuzha
  • 1,761
  • 1
  • 24
  • 45
0

a > span { text-decoration: none: }

Rohith K
  • 1,433
  • 10
  • 15