Img – Image - HTML5 - W3C On GitHub
Có thể bạn quan tâm
jump
HTML: The Markup Language (an HTML language reference)
« iframe input »ⓘ img – image # T
The img element represents an image.
Permitted contents #
empty (void element)
Permitted attributes #
global attributes & src★ & alt & height & width & usemap & ismap & border
ⓘ global attributes Any attributes permitted globally. ⓘ src = non-empty URL potentially surrounded by spaces # A URL referencing a non-interactive, optionally animated, image that is neither paged nor scripted. ⓘ alt = any value # Equivalent content for those who cannot process images or who have image loading disabled. ⓘ height = non-negative integer # The height of the image, in CSS pixels. ⓘ width = non-negative integer # The width of the image, in CSS pixels. ⓘ usemap = hash-name reference # A hash-name reference to a map element with which to associate the image. ⓘ ismap = "ismap" or "" (empty string) or empty # Specifies that its img element provides access to a server-side image map. ⓘ border = zero OBSOLETE # Specifies that its img element represents a borderless image. The literal string "0".Additional constraints and admonitions #
- An img element must have an alt attribute, except under certain conditions. For details, consult guidance on providing text alternatives for images.
- The element img with the attribute usemap must not appear as a descendant of the a element.
- The element img with the attribute usemap must not appear as a descendant of the button element.
- The img element with the ismap attribute set must have an ancestor a element with the href attribute.
- The longdesc attribute on the img element is obsolete. Use a regular a element to link to the description.
- The name attribute on the img element is obsolete. Use the id attribute instead.
- The align attribute on the img element is obsolete. Use CSS instead.
- The hspace attribute on the img element is obsolete. Use CSS instead.
- The vspace attribute on the img element is obsolete. Use CSS instead.
- The border attribute on the img element is obsolete. Use CSS instead.
- The border attribute on the img element is obsolete. Consider specifying “img { border: 0; }“ in CSS instead.
Tag omission #
The img element is a void element. An img element must have a start tag but must not have an end tag.
Permitted parent elements #
any element that can contain phrasing elements
DOM interface #
[NamedConstructor=Image(), NamedConstructor=Image(unsigned long width), NamedConstructor=Image(unsigned long width, unsigned long height)] interface HTMLImageElement : HTMLElement { attribute DOMString alt; attribute DOMString src; attribute DOMString crossOrigin; attribute DOMString useMap; attribute boolean isMap; attribute unsigned long width; attribute unsigned long height; readonly attribute unsigned long naturalWidth; readonly attribute unsigned long naturalHeight; readonly attribute boolean complete; };Typical default display properties #
img { display: inline-block; } « iframe input »Từ khóa » Html5 Image Alt Attribute
-
HTML Img Alt Attribute - W3Schools
-
HTML Alt Attribute - W3Schools
-
: The Image Embed Element - HTML - MDN Web Docs - Mozilla
-
Image ALT Tag Tips For HTML - Accessibility At Penn State
-
Alt Text: Why It's Important For Accessibility & SEO - Moz
-
Image Alt Text: What It Is, How To Write It, And Why It Matters To SEO
-
Alt Attribute - Wikipedia
-
HTML |
Alt Attribute - GeeksforGeeks
-
HTML Img Alt Tags For SEO Best Practice - Search Engines Love ...
-
HTML Img Alt Attribute - Dofactory
-
Image SEO: How To Optimize Your Alt Text And Title Text - Yoast
-
Does The
Element In Html5 Make The "alt" Attribute Obsolete? -
Use The Alt Attribute To Describe The Function Of Each Visual - W3C
-
An Alt Decision Tree | Web Accessibility Initiative (WAI) - W3C