Click to See Complete Forum and Search --> : Those little yellow boxes...


Googs62
08-17-2006, 08:59 AM
I am trying to make those little yellow boxes with text appear when you hold your cursor over an image or link. Here is the code I'm using:

<a href = "ComputerModellingPage.html">
<input type = "image" SRC="Hogmodel.jpg" value = "Click to Enlarge" alt = "Click to Enlarge" VSPACE="5" HSPACE="20" height = "150" width = "195" ALIGN="RIGHT" border = "0"></a>

The problem is when I just make the picture a regular hyperlink without the yellow box command, the link works fine. However, when I insert this line of code, the yellow box pops up, but nothing happens when I click the picture. Does anyone know how to fix this or perhaps a better code?

Thanks friends!

gil davis
08-17-2006, 09:24 AM
I think that you have successfully confused the browser, and it doesn't know what to do. ;)

You have an input type=image surrounded by a hyperlink. The input button action is form submit. Since you have not shown a form tag, I don't know what page it is supposed to submit to, but it is probably not submitting anywhere, so the page just reloads.

The value="..." doesn't do anything for you on type=image.

The hyperlink may have no chance to run because of a race between the input onclick and the anchor onclick. The alt probably brings focus to the image when you mouseover, and thus when you click, the input is what gets the click.

You can add alt or title to an image, so I don't understand why you are using an input type=image instead of an img tag.

What did you really want it to do?

Charles
08-17-2006, 09:52 AM
And you are mis-using the "alt (http://www.w3.org/TR/REC-html40/struct/objects.html#adef-alt)" attribute; use "title (http://www.w3.org/TR/REC-html40/struct/global.html#adef-title)" instead.