Creating HyperLinks without being underlined

北城以北 提交于 2021-02-16 20:05:21

问题


I have a simple question about creating hyperlinks.. clickme creates a hyperlink but click me would be underlined... How do I create a hyperlink where links would not be underlined..Should I be using css??

Thanks


回答1:


use css. something like this:

a
{
text-decoration: none;
}

to restore underline on hover:

a:hover
{
text-decoration:underline;
}

you may replace a with a class selector or an Id.

EDIT: typos;




回答2:


Yes, you should use css.

<a href="link" style="text-decoration: none;">asdf</a>




回答3:


Use css for hiding underline from anchor tag:

'a:link { text-decoration: none}'

http://jsfiddle.net/sushant_ceb/L9KNT/




回答4:


To disable underline for all hyperlinks in the document, use

<STYLE TYPE="text/css">
<!-- 
  A:link {text-decoration: none}
-->
</STYLE>

in the head of your HTML-File.

To only disable underlining for certain hyperlinks, use

<STYLE TYPE="text/css">
<!-- 
  A:link.nounderline {text-decoration: none}
-->
</STYLE>

and define hyperlinks not to be underlined as usual (<a href="://www.google.com">Google</a>), but use your nounderline class for those that shall not be underlined:

<a class="nounderline" href="http://www.yahoo.com">Yahoo</a>



回答5:


To read more about what you can do with text decoration (besides merely underlining or not), read the CSS3 Text Specs.



来源:https://stackoverflow.com/questions/6108349/creating-hyperlinks-without-being-underlined

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!