Цей вебсайт матиме обмежену функціональність, доки ми проводимо його обслуговування для поліпшення роботи. Якщо прочитана стаття не розв'язала вашу проблему і ви хочете поставити питання, наша спільнота підтримки з радістю допоможе вам на @FirefoxSupport у Twitter та /r/firefox на Reddit.

Шукати в статтях підтримки

Остерігайтеся нападів зловмисників. Mozilla ніколи не просить вас зателефонувати, надіслати номер телефону у повідомленні або поділитися з кимось особистими даними. Будь ласка, повідомте про підозрілі дії за допомогою меню “Повідомити про зловживання”

Докладніше

Ця тема перенесена в архів. Якщо вам потрібна допомога, запитайте.

Why doesn't Firefox handle the "alt tag" in html code? - Chrome and IE work fine

  • 2 відповіді
  • 4 мають цю проблему
  • 11 переглядів
  • Остання відповідь від cor-el

more options

For instance in the following html code, 'mousing over' the graphic should display the "img alt" phrase: "Geenee House exchange -Vacations - This opens a new window!"

It doesn't. In Chrome and IE there is no problem - have I missed something? - help - Dave

html code: <a accessKey="1" href="http://www.geenee.com/" target="_blank"><img alt="Geenee House exchange -Vacations - This opens a new window!" src="images/geenee.gif" border="2" width="160" height="62"> </a>

page where 'most' of graphics have a 'text' alt tag can be seen at http://www.spainforyou.net/

For instance in the following html code, 'mousing over' the graphic should display the "img alt" phrase: "Geenee House exchange -Vacations - This opens a new window!" It doesn't. In Chrome and IE there is no problem - have I missed something? - help - Dave html code: &lt;a accessKey="1" href="http://www.geenee.com/" target="_blank"&gt;&lt;img alt="Geenee House exchange -Vacations - This opens a new window!" src="images/geenee.gif" border="2" width="160" height="62"&gt; &lt;/a&gt; page where 'most' of graphics have a 'text' alt tag can be seen at [http://www.spainforyou.net/]

Змінено cor-el

Усі відповіді (2)

more options

Running Firefox 10.0.1, this problem is still present. You can go to http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_image_test to see the W3 Schools tag's test which includes an alt= tag; the text associated with the alt= does not display.

more options

The Alt attribute isn't meant to show as a tooltip on hover.
The Alt attribute is meant to show if the image isn't or can't be displayed.
The title attribute is meant to show if you hover an image or link.
If there is no title attribute, but there is an alt attribute then IE will show the alt attribute as a tooltip.
Firefox doesn't do that, so if the title attribute is missing then you do not see a tooltip if you hover an image or link.


So if you add title="Smiley face" then Firefox will display the tooltip.

<img src="smiley.gif" alt="Smiley face" width="42" height="42" title="Smiley face" />