Harvard Extension School
CSCI E-12 Fundamentals of Web Site Development | Spring 2020

## Common HTML5 Elements - Embedded content

- `img` element
- Key attributes
  - `src`
  - `alt`

### img element

HTML documents do not contain the images themselves, but merely contain references to the images to be displayed. Common image file types are:

- GIF, Graphics Interchange Format, ".gif"
- JPEG, Joint Photographic Experts Group, ".jpg", ".jpeg"
- PNG, Portable Network Graphics, ".png"

Example 2.9 - img element - Example 2.9

- Markup
- Display

    <img src="http://cscie12.dce.harvard.edu/images/harvard-extension-school-shield.png" alt="Harvard University Extension School Shield" height="330" width="287"/>

Example 2.10 - 'img' element with an anchor - Example 2.10

- Markup
- Display

    <a href="http://extension.harvard.edu/"><img src="http://cscie12.dce.harvard.edu/images/harvard-extension-school-shield.png" alt="Harvard University Extension School Shield" height="330" width="287"/></a>

Copyright © David Heitmeyer