Img element
The HTML img element embeds an image resource in a document.
Web Design Playground, Second Edition
The HTML img element embeds an image resource in a web document.
- How it is used
- Embeds separate image files, provides accessible alternatives, links images, aligns them with text, and adapts them to changing container widths.
- How deep it goes
- Explains syntax, file paths, accessibility, linking, alignment, and responsive sizing, but stops short of advanced image delivery.
- Examples
- Uses a company logo, a clickable logo, trail images aligned with labels, and an image scaling inside a responsive aside.
- What you can do after
- Build it from scratch by embedding, describing, linking, aligning, and responsively sizing images with HTML and CSS.
Read how Web Design Playground, Second Edition explains img element →
Web Design Playground
An HTML element that embeds an image in a web page.
- How it is used
- Embeds separate image files in page content, including logos, thumbnails, linked images, and semantically framed figures.
- How deep it goes
- Defines syntax, file paths, accessibility text, tooltips, inline flow, and alignment, while deferring image backgrounds to CSS.
- Examples
- Uses a company logo, gallery thumbnails, linked pictures, and a standard src-alt-title code pattern.
- What you can do after
- Build it from scratch by locating an image file, writing an img element, supplying alt text, and adjusting alignment.
Build a Website with ChatGPT
The img tag is HTML markup that embeds an image resource in a web page.
- How it is used
- Embeds external image files in an HTML page and supplies their locations and alternative descriptions.
- How deep it goes
- Defines src and alt, explains file paths and accessibility, and stops short of advanced image behavior.
- Examples
- Uses logo files, an old road-marker photograph, descriptive alt text, and empty alt text for decorative images.
- What you can do after
- Build it from scratch by inserting an image, pointing src to its file, and writing appropriate alt text.
Read how Build a Website with ChatGPT explains img element →
Also covered in
What to know first
- HTMLHTML is the standard markup language for structuring content and elements in documents on the web.
- digital imageA digital image is a digital representation of visual content, commonly encoded as an arrangement of pixels or other graphical elements.
- anchor elementAn anchor element is an HTML element that represents a hyperlink or navigation target, typically linking content to another resource or location.
- HTML elementAn HTML element is a structural or semantic unit of an HTML document, defined by markup and represented in the document tree.
Related concepts
- anchor elementused by · An anchor element is an HTML element that represents a hyperlink or navigation target, typically linking content to another resource or location.
- digital imageuses · A digital image is a digital representation of visual content, commonly encoded as an arrangement of pixels or other graphical elements.
- inline containerkind of · An inline container is an HTML element that participates in inline layout, flowing with surrounding content and potentially wrapping within its containing block.
- src attributeconfigured by · The HTML src attribute specifies the URL of an external resource that an element retrieves or embeds.
- alternative texthas part · Alternative text is textual content associated with non-text content that conveys its meaningful information or purpose to people who cannot perceive it visually.
Questions about img element
What is img element?
The HTML img element embeds an image resource in a document.
Which Manning books explain img element?
Web Design Playground, Second Edition, Web Design Playground and Build a Website with ChatGPT.
What should I know before learning img element?
Manning books that teach img element usually introduce HTML, digital image, anchor element and HTML element first.
What is img element a kind of?
Img element is a kind of inline container. An inline container is an HTML element that participates in inline layout, flowing with surrounding content and potentially wrapping within its containing block.
What are the parts of img element?
Img element includes alternative text.
What is img element also called?
Img element is also called <img> tag.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


