用href属性删除下划线 [英] Removing underline with href attribute

查看:123
本文介绍了用href属性删除下划线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能存在重复:


在下面的代码中,当我使用href属性时,链接被加下划线。

 < html> 
< body>
< a href =xxx.html>转到此连结< / a>
< / body>
< / html>

我希望链接与该标记相关联,但不要加下划线。我怎样才能做到这一点?感谢您的帮助。

使用属性添加样式text-decoration:none; :



有很多不同的方法可以做到这一点。

内联风格:

 < a href =xxx.htmlstyle =text-decoration: none;>转到此链接< / a> 

内联样式表:

 < html> 
< head>
< style type =text / css>
a {
text-decoration:none;
}
< / style>
< / head>
< body>
< a href =xxx.html>转到此连结< / a>
< / body>
< / html>

外部样式表

 < html> 
< head>
< link rel =Stylesheethref =stylesheet.css/>
< / head>
< body>
< a href =xxx.html>转到此连结< / a>
< / body>
< / html>

stylesheet.css:

  a {
text-decoration:none;
}


Possible Duplicate:
How to remove the underline for anchors(links)?

In the following code below, the link gets underlined when I use the href attribute.

<html>
<body>
<a href="xxx.html">goto this link</a>
</body>
</html>

I want the link to be associated with that tag, but not to be underlined. How can I do that? Thanks in advance for your help.

解决方案

Add a style with the attribute text-decoration:none;:

There are a number of different ways of doing this.

Inline style:

<a href="xxx.html" style="text-decoration:none;">goto this link</a>

Inline stylesheet:

<html>
<head>
<style type="text/css">
   a {
      text-decoration:none;
   }
</style>
</head>
<body>
<a href="xxx.html">goto this link</a>
</body>
</html>

External stylesheet:

<html>
<head>
<link rel="Stylesheet" href="stylesheet.css" />
</head>
<body>
<a href="xxx.html">goto this link</a>
</body>
</html>

stylesheet.css:

a {
      text-decoration:none;
   }

这篇关于用href属性删除下划线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆