2011-08-09 55 views
1

我有jQuery的锚标记为如何删除下划线的锚链接jQuery中

success: function(result) { 
    $('#MyGrid tbody').append('<tr><td><a STYLE="text-decoration:none" href="#"><font color=black><strong>' + result.name+ '</font></a></td></tr>'); 

删除我添加了一些样式属性的下划线,但不删除underline.How我可以删除下划线为锚标签?

感谢, michaled

+0

你可以发布删除类的CSS定义吗? –

+0

其实storng正在采取强调风格下划线属性我已经添加了强烈的风格=“文字装饰:无”,解决了我的问题thnx – michael

回答

0

尝试正确关闭你的锚,字体和强大的标签:

success: function(result) { 
    $('#MyGrid tbody').append('<tr><td><a STYLE="text-decoration:none"><font color="black"><strong>' + result.FileName + '</strong></font></a></td><td><a href="#" class="remove">Remove</a></td></tr>'); 
} 
+0

al标签已正确关闭我已编辑我的代码sry的错字错误 – michael

0

你忘了关锚标记附近的字体标签

试试这个我我不确定它是否正确

$('#MyGrid tbody').append('<tr><td><a STYLE="text-decoration:none"><font color=black><strong>' + result.FileName + '</a></td><td><a href="#" class="remove">Remove</a></td></tr>'); 

或尝试t他

$('#MyGrid tbody').append('<tr><td><a><font color=black><strong>' + result.FileName + '</a></td><td><a href="#" class="remove">Remove</a></td></tr>'); 
$('#MyGrid tbody tr td a').css("text-decoration","none"); 
-1

你可以尝试这样的事情:

<a href="#" style="text-decoration : none">HTML Hyperlink without Underline using inline style</a> 

这为我工作。

要不然你可以用CSS样式尝试:

<html> <head> 
<title>HTML Hyperlink No Underline</title> 
<style type="text/css"> 
a {font-family : Arial; Font-size : 12px; text-decoration : none} 
a:link {color : #ff0000} 
a:visited {color : #00ff00} 
a:active {color : #666666} 
a:hover {color : #0000ff} 
</style> 
</head> 
2

试试这个有重要的是,在任何情况下,其他样式规则覆盖有重要的内嵌样式。

$('#MyGrid tbody').append('<tr><td><a style="text-decoration:none !important;" href="#"><font color=black><strong>' + result.name+ '</font></a></td></tr>');