Pregunta

I'm testing my code in HTML to make sure I've done everything correctly and I can't seem to get the alt text displayed on my browser. I tried with latest version of Chrome and Firefox..

<center>
<img src="http://www.opstinavinica.gov.mk/vinica/images/logogd.png" align=top alt="E ova e logoto!!!!">Ova e logoto na <b>UGD</b>
</center>

Sorry about the foreign language.. I can translate it if necessarry.

EDIT: What is the tag to display text while mouse is over the image if alt is for displaying text for broken images only?

Example

¿Fue útil?

Solución 3

The alt property sets or returns the value of the alt attribute of an image.

The required alt attribute specifies an alternate text for an image, if the image for some reason cannot be displayed (because of slow connection, an error in the src attribute, or if the user uses a screen reader).

Note: Internet Explorer displays the value of the alt attribute as a tooltip when mousing over the img element. This is NOT the correct behavior, according to the HTML specification. All other browsers are following the specification, and will only display the alt text if the image cannot be displayed.

Otros consejos

Unlike Microsoft Internet Explorer, Mozilla Firefox and Chrome will not display the text used in the alternative tag since this text is meant to be used for accessibility and not meant as the text to be shown in the balloon text when the mouse is hovered over the image.

If you would like to have balloon text appear when the mouse hovers over an image add the "title" tag to the img html tag.

Just set a title tag for this to work in modern browsers :

<center>
<img src="http://www.opstinavinica.gov.mk/vinica/images/logogd.png" align=top title="E ova e logoto!!!!" alt="E ova e logoto!!!!">Ova e logoto na <b>UGD</b>
</center>

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top