PDA

View Full Version : CSS wrecks onclick in NS4


pairustwo
12-14-2002, 07:28 PM
I'm trying to get an onclick to work in NS4 but if I apply a style to img (which fires the onclick) it fails in NS4. This is important because it takes NS4 to an upgrade message. <div style="position:relative; top: 12%; left:35%;">
<a href="#" onclick="return fire()"><img src="images/indexbg.gif" alt="open our page" border="0"></a>
</div> I've applied the style inline to the a tag, redefined the a tag with styles in the head - taken the image out of the div, left it in the div tag... all with the same result.

If it take the style off it works fine. Whats up with that?

Pairustwo

cheesebagpipe
12-14-2002, 10:07 PM
Not 'applying a style' - you're creating a layer, and an <ilayer> at that (bug central). Good way to disable a link. If you must, try something like this:

<div style="position:relative; top: 12%; left:35%;">
<div style="position:absolute;"><a href="#" onclick="return fire()"><img src="images/indexbg.gif" alt="open our page" border="0"></a></div></div>

Wraps it in a <layer>, they work (occasionally).