Html image code

about lee

Addicted
Joined
Apr 8, 2010
Messages
937
Reaction score
0
FP$
6
Right just tried to validate my website and the only errors on my page which is 22 errors are all to do with the same bit of code.

I have this code:

<A HREF="packfour.html"><IMG SRC="images/packagefourinfo.png" ALT="Home"></A>

leading to different pages images etc.. but they all seem to be given an error. Does anyone know a HTML click-able image code?
 
Wouldn't the code be:

Code:
<a href="www.yoursite.com/packfour.htm."><img scr="www.yoursite.com/images/packagefourinfo.png"></a>

Because that image would link to the page your trying to link it too I believe.

Correct it if I'm wrong, coding is not my strong point.
 
Na its not that either, If someone knows or want to see the errors contact me and ill send you a link.

Im getting a lot of: there is no attribute "WIDTH", there is no attribute "SRC", there is no attribute "ALT" Etc...
 
Do you want to PM me the link of the specific page? I might be able to help.
 
You can send me the error, but the above code is correct to a certain extent. Simply:

Code:
<a href="http://www.site.com"><img src="http://image.site.com/image.png" width="0" height="0" border="0" alt="Random image" /></a>

... would be enough. Be sure your image is actually there.
 
What doctype are you using?

If it's XHTML, then I 'think' it should be:
Code:
<a href="packfour.html"><img src="images/packagefourinfo.png" alt="Home" title="Home" width="INSERT WIDTH HERE" height="INSERT HERE HERE" border="0" /></a>

You were missing attributes like width, height, border and title.

Also, they should be lowercase.


If you're using HTML 4 and not XHTML, I think that might still work, but not 100% sure.
 
Yes dude that last code worked! Still got like 12 errors tho. Maybe you can take a look for me?
 
about lee said:
Yes dude that last code worked! Still got like 12 errors tho. Maybe you can take a look for me?
What's the link? It would certainly help 🙂
 
Back
Top Bottom