bumblebee
bumblebee

Reputation:

Creating HyperLinks without being underlined

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

Upvotes: 2

Views: 278

Answers (5)

chharvey
chharvey

Reputation: 9326

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

Upvotes: 0

Mel
Mel

Reputation: 3128

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;

Upvotes: 9

Sushant Prasad
Sushant Prasad

Reputation: 122

Use css for hiding underline from anchor tag:

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

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

Upvotes: 1

eckes
eckes

Reputation: 67047

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>

Upvotes: 0

gnur
gnur

Reputation: 4733

Yes, you should use css.

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

Upvotes: 1

Related Questions