English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Wenn das Bild nicht angezeigt wird, wird der alt-Attribut den alternativen Text für den Bereich angeben. Wenn der Benutzer aus irgendeinem Grund das Bild nicht sehen kann (aufgrund einer langsamen Verbindungsgeschwindigkeit, eines fehlenden src-Attributs oder wenn der Benutzer einen Screenreader verwendet), stellt das alt-Attribut dem Bild alternativen Text zur Verfügung.
Bilder mit klickbaren Bereichen: Mapping
<!DOCTYPE html> <html> <title>HTML:<area> alt-Attribut - Grundlegende Anleitungswiki oldtoolbag.com</title> <body> <p>Klicken Sie auf die Sonne oder einen der Planeten, um sie aus der Nähe zu betrachten</p> <img src="planets.gif" width="145"height="126"alt="Planets" usemap="#planetmap"> <map name="planetmap"> <area shape="rect" coords="0,0,82,126"href="sun.html" alt="Sun"> <area shape="circle" coords="90,58,3"href="mercur.html" alt="Mercury"> <area shape="circle" coords="124,58,8" href="venus.html" alt="Venus"> </map> </body> </html>Test to see ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the alt attribute.
If the image cannot be displayed, the alt attribute specifies the alternative text for the area.
If the user cannot view the image for some reason (due to slow connection speed, src attribute error, or the user uses a screen reader), the alt attribute provides alternative information for the image.
The alt attribute is required if the href attribute exists.
In HTML 4.01The alt attribute is required.
In HTML5In, the alt attribute is required only if the href attribute exists. If the href attribute does not exist, the alt attribute should not be used.
<area alt="text">
Value | Description |
---|---|
text | Specify alternative text for the area when the image cannot be displayed. |