Interview Questions

How to make text-links without underline?

CSS Interview Questions and Questions


(Continued from previous question...)

70. How to make text-links without underline?

a:link, a:visited {text-decoration: none}

or

<a style="text-decoration: none" HREF="...">

...will show the links without underlining. However, suppressing the underlining of links isn't a very smart idea as most people are used to having them underlined. Also, such links are not spotted unless someone coincidentally runs a mouse over them. If, for whatever reason, links without underline are required background and foreground colors can be instead declared to them so that they can be distinguished from other text, e.g.;

a:link, a:visited {text-decoration: none; background: red; color: blue}

or

<a style="text-decoration: none; background: red; color: blue" HREF="...">

Both background and foreground colors should be specified as the property that is not specified can be overridden by user's own settings.

(Continued on next question...)

Other Interview Questions