HTML Alt Attribute - HTML Tutorials - W3resource
Có thể bạn quan tâm
alt
The purpose of the HTML alt attribute is to specify a short description for the supported elements.
Supported elements
HTML alt attribute supports area, img, input elements.
Syntax
<ElementName alt="value" >.....</ElementName>Where ElementName is any supported element.
Type of value
Type of value of HTML alt attribute is text.
Value
A piece of text containing a short description of the adjacent content.
Default value
There is no default value of HTML alt attribute.
Supported doctypes
HTML 4.01 strict, HTML 4.01 transitional, HTML 4.01 frameset.
Example of HTML alt attribute with img and area
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Example of HTML alt attribute with area and img </title> </head> <body> <img src="attribute-alt-img-area.gif" alt="alt example " width="308" height="190" border="0" usemap="#Map"> <map name="Map"> <area shape="rect" coords="8,5,100,77" href="../../mysql/mysql-tutorials.php" target="_blank" alt="mysql tutorial"> <area shape="circle" coords="155,93,59" href="../../php/php-home.php" target="_blank" alt="php tutorial"> <area shape="rect" coords="197,136,306,188" href="../../sql/sql-tutorials.php" alt="sql tutorials"> </map> </body> </html>Result
View this example in a separate browser window
Example of HTML alt attribute with img and area.
Example of HTML alt attribute with input
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Example of HTML alt attribute with input</title> </head> <body> <form action="action.php"> Email id : <input type="text" name="email" alt="Your Email id"/><br /> Password : <input type="text" name="passw" alt="Your Password"/><br /> <input type="submit" value="Submit" /> </form> </body> </html>Result
View this example in a separate browser window
Example of HTML alt attribute with input.
Previous: HTML align attribute Next: HTML archive attribute
Từ khóa » Html 5 Alt Text
-
HTML Img Alt Attribute - W3Schools
-
HTML Alt Attribute - W3Schools
-
Alt Text: Why It's Important For Accessibility & SEO - Moz
-
Image ALT Tag Tips For HTML - Accessibility At Penn State
-
Alt Attribute - Wikipedia
-
HTML5: Techniques For Providing Useful Text Alternatives - W3C
-
HTML Img Alt Tags For SEO Best Practice - Search Engines Love ...
-
Image Alt Text: What It Is, How To Write It, And Why It Matters To SEO
-
Requiring The Alt Attribute In HTML5 - Juicy Studio
-
HTML | Alt Attribute - GeeksforGeeks
-
: The Image Embed Element - HTML - MDN Web Docs - Mozilla
-
t - Web APIs | MDN
-
Learn How Does Alt Tag Work In HTML With Examples - EduCBA
-
Examination Of Alt Text Guidance In The HTML5 Draft