Solved: alt tags not working

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

chrissy1955

Thread Starter
Joined
Jan 29, 2010
Messages
51
Hi. I am trying to do an alt tag but it sits permanantly to the side of the image whereas it should float over the image when i hover the mouse.

<a href="joeshome.html"> Home <img src="iceberg.jpg" border="5" alt="Home" height="100" width="150"></a>
<br>
<a href="joesproduce1.html"> Produce <img src="cos.jpg" border="5" alt="Produce" height="100" width="150"></a>
<br>
<a href="joeshistory.html"> History <img src="fancy.jpg" border="5" alt="History" height="100" width="150"></a>


These are the html codes for the 3 images I am using unsuccessfully. Where am I going wrong?:(

many thanks
 
Joined
Aug 12, 2007
Messages
696
Are you *sure* that's what is happening? Try this code instead and tell us what you get:

Code:
<a href="joeshome.html"><img src="iceberg.jpg" border="5" alt="Home" height="100" width="150"></a>
<br>
<a href="joesproduce1.html"><img src="cos.jpg" border="5" alt="Produce" height="100" width="150"></a>
<br>
<a href="joeshistory.html"><img src="fancy.jpg" border="5" alt="History" height="100" width="150"></a>
 
Joined
May 20, 2010
Messages
4,038
Hi Chrissy1955,

Seems like you are repeating the same mistake which you have done in here
http://forums.techguy.org/web-design-development/971520-solved-learning-html-links.html

<a href="joeshome.html"> Home <img src="iceberg.jpg" border="5" alt="Home" height="100" width="150"></a>
This code is meaningless. Either you have to finish the <a> before jumping to the <img> or you have to give a image link. I am not correcting the code code because ehymel has already done that.

But I need to say something else.
<img src="iceberg.jpg" border="5" alt="Home" height="100" width="150">
This is a correct HTML code but a wrong XHTML code. The simple meaning of the XHTML is "well formed HTML". You have to close the <img> tag, even it has no closing tag. Close it like this.

<img src="iceberg.jpg" border="5" alt="Home" height="100" width="150" />
 
Joined
Aug 12, 2007
Messages
696
Sepala,
Chrissy's html code is correct, I'm not sure why you are saying she has to close the <a> tag before going on to the <img> tag. She did that! I think what happened is that she is perhaps confusing the text next to the image as the alt tag. I suggested removing the text and see if this is the desired result.

I don't think she ever specified using xhtml code, certainly not everyone uses that. Depends on her doctype specifications of course. The html code as written is just fine.
 

chrissy1955

Thread Starter
Joined
Jan 29, 2010
Messages
51
Thanks guys, I have copied and pasted in E html codes. I see that the difference is the word home was sitting in there between the <a and before the <img....that has now taken away the word which was a ling to another page. I can see that if I hover over the image down in the bottom left hand corner of the screen it tells me that if I click it will take me to the page I want it to take me, however when the hand comes up when hovering, i would expect to see the word, home, produce or history depending on the image I am hovering above but this still does not happen, any further ideas?
 
Joined
Aug 12, 2007
Messages
696
What browser are you using? Sounds like you are looking for the "title" attribute in firefox.

Code:
<a href="joeshome.html"><img src="iceberg.jpg" border="5" alt="Home" title="Home" height="100" width="150"></a>
 
Joined
May 20, 2010
Messages
4,038
Chrissy's html code is correct, I'm not sure why you are saying she has to close the <a> tag before going on to the <img> tag. She did that! I think what happened is that she is perhaps confusing the text next to the image as the alt tag. I suggested removing the text and see if this is the desired result.
In her code, Both text, and picture, act as a link because of this

<a href="joeshome.html"> Home <img src="iceberg.jpg" border="5" alt="Home" height="100" width="150"></a>

Normally we are not doing that isn't it? If she need that, no problem. But I think she need to give an image link, that's why I tell that. Anyway I am not talking about ORDER OF TAG CLOSING(I think you thought I am talking about this).

I don't think she ever specified using xhtml code, certainly not everyone uses that. Depends on her doctype specifications of course. The html code as written is just fine.
Yes, XHTML is not mandatory, But I can't agree with you with this
certainly not everyone uses that
Most people use this, But I know most beginners don't use it, but it is advisable to use that because that is a standard of W3C(Anyway technology is something we can round up! )

The html code as written is just fine.
Yes, that's why I said this is a correct HTML but wrong XHTML
 

chrissy1955

Thread Starter
Joined
Jan 29, 2010
Messages
51
I have removed both the word home in the href part and then the actual alt="home". It seems that the alt="home" is having absolutely no effect.

Yes I am certainly a beginner an not farmiliar with xhtml

all help greatly appreciated
 
Joined
May 20, 2010
Messages
4,038
I have removed both the word home in the href part and then the actual alt="home". It seems that the alt="home" is having absolutely no effect.
If the web browser is not supporting to images or if image option is disabled, then the things inside the ALT will be displayed. That is why we use it.
 

chrissy1955

Thread Starter
Joined
Jan 29, 2010
Messages
51
I undeerstand that but I also thought the word "Home" (in my scenario) should be shown when I hover - perhaps this is where I am going wrong?
 
Joined
May 20, 2010
Messages
4,038
There is another way to do that, that is using <anchor title="">. This is used when you are not using <a>.
example
<anchor title="sdfnkfgnkdfng"><img src="Andermatt-1.gif" alt = "Andermat"/></anchor>

This will work on FireFox, and all other browsers which is using NetsCape Navigator Technology
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top