...

View Full Version : Image link not working! UGH



velious
06-21-2010, 01:44 AM
[code] <A HREF="http://www.google.com"><IMG SRC="jeff1.jpg" BORDER=0 HEIGHT=120 WIDTH=500"/> </A> [icode]

I tried to copy code from other sites like w3schools and others, and just change the values, but its not working!. I NEVER in my life had such a problem with this, and im at wits end.

Any help is mostly appretiated. Thanks

ps both the html file and jeff1.jpg are on my desktop. I made sure they were typed in right also.

Philly100000
06-21-2010, 02:33 AM
Try using this code

<a href="http://www.google.com/"><img src="jeff1.jpg" alt="" height="120" width="500" border="0"></a>

Also if it doesn't work, put the image in the folder that your HTML Page is in, that could be the main problem.

velious
06-21-2010, 03:54 AM
Thanks Philly. Been a while sense I used html.

velious
06-21-2010, 03:59 AM
No that code isnt working and I put all the files in the same folder.

Philly100000
06-21-2010, 04:04 AM
That's odd, it works for me when I put it in something, could I see some of the rest of the code in between where your trying to add it to?

_Aerospace_Eng_
06-21-2010, 07:03 AM
You sure the html file is on your desktop and are you sure that it is .jpg and not .JPG? Are you sure that it is even a jpeg image. Right click the file and open it firefox or internet explorer.

A.T.
06-21-2010, 01:31 PM
You are probably using the wrong extension for your image. I come across the same thing a lot. Try capitalizing it (jeff1.JPG instead of jeff1.jpg) and if that doesn't work, double-check what the extention is by looking at the file properties, or like Aerospace said, opening it in a browser. The adress bar will show you the proper extension.

If all else fails, delete the img code and type it all over. I know that sounds pointless, but it's happened to me before that I was 100% certain my img tag was flawless, but no matter what I did I couldn't make the image show up, until I simply deleted it and wrote it out anew.

Major Payne
06-22-2010, 05:08 AM
The link itself should work regardless of whether the image loads or not, but you really need to include the alt="" text description so you'll have a text link at least. Also, if you are using XHTML 1.0, be sure the closing tag has a space before the "/". If NOT, using XHTML 1.0, remove all " /" from those tags that don't normally have closing tags. Might want to also validate both your CSS and HTML coding at the w3c.org's validators.

Making an image a link:


<p><a href="URL path to external link" title="Mouseover Description"><img style="width: XXpx; height: YYpx; border: 0;" src="Path to image" alt="Text Description"></a></p>

If site does not host images, then you MUST host your image online at any good image hosting site. The "src" image URL MUST be the DIRECT link to the image alone and not to the page the image is on. Put the correct link for the site in the href="" attribute. Put the DIRECT URL to ONLY the image in the src="" attribute.

Text Link only:


<p><a href="URL path to external link" title="Mouseover Description">Link Text Description</a></p>

You can change the "p" tags to div tags and style as needed.

Practice Your Link Code Online (http://www.w3schools.com/HTML/tryit.asp?filename=tryhtml_imglink)

velious
06-22-2010, 07:22 AM
I got it to work now...on my desktop at least. Thanks.

Now I have a question about tables. Can HTML format tables in this style?.http://tinypic.com/view.php?pic=10yqq0j&s=6

Major Payne
06-22-2010, 07:31 AM
I got it to work now...on my desktop at least. Thanks.

Now I have a question about tables. Can HTML format tables in this style?.http://tinypic.com/view.php?pic=10yqq0j&s=6Yes, but you would be better off coding to the latest web standards and NOT use tables for layouts. Just use tables for their originally intended purpose...data presentation.

Might help...

Tableless Web Design: http://en.wikipedia.org/wiki/Tableless_web_design
Why tables for layout is stupid: http://www.hotdesign.com/seybold/
How to convert manually your HTML tables to CSS: http://www.table2css.com/articles/convert-your-html-tables-to-css
Images, Tables, and Mysterious Gaps: https://developer.mozilla.org/en/Images,_Tables,_and_Mysterious_Gaps



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum