Home > Basics > Link Without Underline Tutorial

Link Without Underline Tutorial

November 14th, 2008

Sometime we will need to create a link without the underline so that it fits better with our text. Its fairly simple here goes:

PHP Programmer
vs.
PHP Developer

Simply add this style to the css stylesheet for anchor tags to be displayed without the underline or to the link code:

<a href=”#” style=”text-decoration:none;”>Link</a>

These decoration values dont work with all browsers but are worth knowing:

none, underline, overline, line-through or blink

Some of you may be looking for a simple way to write a PHP link, well here goes:

echo ‘<a href=”‘. $linkVar .’” style=”text-decoration:none;”>’. $nameVar .’</a>’;

or

echo ‘<a href=”#” style=”text-decoration:none;”>My Link</a>’;

Basics

  1. No comments yet.
  1. No trackbacks yet.