禁用带下划线的锚标记的内部元素的下划线

Pra*_*wat 2 html css

我们可以禁用带下划线的锚标记的内部跨度元素的下划线吗?如果可能,请告诉我如何?

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

 <style type="text/css>
     a{
        text-decoration:underline;
     }
     a span{
        text-decoration:none;
     }
 </style>
Run Code Online (Sandbox Code Playgroud)

Man*_*zha 6

尝试这个。

添加display: inline-block;跨度样式

a {
    text-decoration:underline;
}

a span {
    text-decoration:none;
    display: inline-block;
}
Run Code Online (Sandbox Code Playgroud)

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