link within image, whats the html?

liunx

Guest
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!<br />
<br />
i would prefer you email me an email with the subject: image html to the email address: <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e --><br />
<br />
thank you very much!<br />
-alanna<!--content--><a href=http://www.webdeveloper.com/forum/archive/index.php/"http://www.w3.org/"><img alt="W3C" src="http://www.w3.org/Icons/w3c_home"></a><!--content--><a href=http://www.webdeveloper.com/forum/archive/index.php/"somewhere.htm"><img src="mypic.jpg" width="200" height="200"></a><br />
<br />
try that.<br />
<br />
Technically it shouldn't be valid, but it works.<br />
<br />
You could use <br />
<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"somewhere.htm" style="display:block;"><img src="mypic.jpg" width="200" height="200"></a><br />
<br />
to make it technically valid, but that might screw up the rest of your page.<!--content-->oops - sorry Charles. You must type faster than I do LOL<!--content-->1) The IMG element is an inline element and can be properly contained by an A element.<br />
<br />
2) Changing the "display" property to block will not make it valid for the A element to contain a block level element.<br />
<br />
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=http://www.webdeveloper.com/forum/archive/index.php/"www.w3.org/">here</a> for the W3C are likewise problematic.<!--content-->True - I was momentarily confused by the fact you can set a height for it.<br />
<br />
Make that think and type faster LOL.<!--content-->
 
Back
Top