devxlogo

Apply a DHTML Effect to a Specific Style

Question:
I have two different styles on my page: “content” and “small”. To avoid the “onmouseover…” lines within the tags, I defined the A:Hover line. Now if a user moves the mouse over a link, the text changes to red. The problem is that I want the red onmouseover effect only on the text with the “content” style. For the “small” style, I can’t seem to define its own onmouseover color.

Answer:

You can define a specific style and give it a class name, and this technique applies to pseudo-classes such as A:hover:

Use the classes as follows:

test one

test two

Note that Navigator 4.x doesn’t support the hover pseudo class.

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  Seven Service Boundary Mistakes That Create Technical Debt

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.