Monday, September 20, 2010

How to get HTML link or anchor tag without underline

by Emmaneale Mendu, Web Developer
Basic anchor or link code looks like this
<a href="">Visit</a>

On Web browser this looks like

Let’s work with style property to remove the Underline to the link; basically if the text is underlined then by default user thinks it’s a link. But in some cases the requirement will be without underline.
We use “text-decoration” to overcome this issue. This is a style property we do have none|inherit|combination of ‘underline’,’overline’,’line-through’ and ‘blink’


style="text-decoration:none" (remove complete decoration like underline)
style="text-decoration:blink" (wont work in IE but works in Mozila)

If you are using style="text-decoration:none"

<a href="" style="text-decoration:none">Visit</a>

Output looks like

No comments:

Post a Comment