devxlogo

Apply a DHTML Effect to a Specific Style

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.

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