devxlogo

Changing Link Color with Mouseovers

Changing Link Color with Mouseovers

Question:

How can I change the color of a link when the mouse is over the link? And how can I remove the line that underlines the links? I am using Internet Explorer 4+ and Netscape 4+.

Answer:

Actually, this may be done with CSS, not JavaScript, but I can give you the answer anyway. However, be forewarned that it doesn’t work in Netscape versions prior to version 6.

Add the following code inside your tag:

“text-decoration:none” says to not display underlines on anchor tags, while “text-decoration: underline” says to display the underline when the user hovers over the link. In the same way, the text will change to red, because of the “color:red” style.

See also  Why ChatGPT Is So Important Today
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist