How to display a link without underline and display underline when mouseover on the link using CSS?

 Posted by Raja on 1/9/2009 | Category: CSS 3 Interview questions | Views: 16474
Answer:

Write following css class.

a

{
text-decoration:none;
}

a:hover
{
text-decoration:underline;
}


The first class will force all anchor tag (link)to not display any docoration (underline) and second class will force all anchor tag (link) to display text decoration as underline when mouse over it (ie. display underline when mouse over).


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response