Click to See Complete Forum and Search --> : link within image, whats the html?
alannamichelle
10-25-2003, 03:30 PM
Hey, i was wondering if anyone knows the html to put on my homepage so that if someone clicks on a certain image it will take them to another site of my choice... let me knoW!
i would prefer you email me an email with the subject: image html to the email address: BlueWaterLily06@aol.com
thank you very much!
-alanna
Charles
10-25-2003, 03:36 PM
<a href="http://www.w3.org/"><img alt="W3C" src="http://www.w3.org/Icons/w3c_home"></a>
DaveSW
10-25-2003, 03:39 PM
<a href="somewhere.htm"><img src="mypic.jpg" width="200" height="200"></a>
try that.
Technically it shouldn't be valid, but it works.
You could use
<a href="somewhere.htm" style="display:block;"><img src="mypic.jpg" width="200" height="200"></a>
to make it technically valid, but that might screw up the rest of your page.
DaveSW
10-25-2003, 03:43 PM
oops - sorry Charles. You must type faster than I do LOL
Charles
10-25-2003, 03:48 PM
1) The IMG element is an inline element and can be properly contained by an A element.
2) Changing the "display" property to block will not make it valid for the A element to contain a block level element.
3) The "alt" attribute is required with the IMG element and is extremely important when the image is used as a link text. People with visual difficulties, and Opera users, often call up a list of all of the links on a page. With image links the value of the "alt" attribute is used so the value of the "alt" attribute needs to be unique on the page and to make sense out of context (Things like Click <a href="www.w3.org/">here</a> for the W3C are likewise problematic.
DaveSW
10-25-2003, 04:06 PM
True - I was momentarily confused by the fact you can set a height for it.
Make that think and type faster LOL.