Using text-decoration CSS Property
CSS text-decoration property is used to define the text-formatting.
Below are the possible values for text-decoration property
underline: The text is underlines
overline: Each line of text has the line above it
line-through: Defines a line though the text
blink: This makes the text blinking (Not supported in IE, Chrome, Safari)
none: No formatting is applied
text-decoration values are inherited from its parent elements (except in < IE8 browsers)
Example:
<a href="http://ankurgupta.com/blog">Learn how to use css</a> <br/><br/> <a href="http://ankurgupta.com/blog" class="no-decor"> Learn using text-decoration css property </a> <br/><br/> <a href="http://ankurgupta.com/blog" class="line-through-decor"> Learn using text-decoration css property </a>
Most of the anchor tags by default has text-decoration property value set to underline, if you do not want this underline you can change the property value.
.no-decor { text-decoration:none; color: #1111cc; } /* css for line-through text */ .line-through-decor { text-decoration:line-through; }
When we apply this css, it will look like this
Now the anchor text will not have the underline, if you need to remove the underline while hovering the text as well. define the same css style for a:hover
too