Main content
Unlisted resources area
Course: Unlisted resources area > Unit 2
Lesson 2: Webpage documentation- HTML: The h1 to h6 tags
- HTML: The p tag
- HTML: The br tag
- HTML: The ul, ol, and li tags
- HTML: The strong and em tags
- HTML: The a tag
- HTML: The image tag
- HTML: The table tags
- CSS: The element selector
- CSS: The descendant selector
- CSS: The class selector
- CSS: The id selector
- CSS: The color property
- CSS: The background-color property
- CSS: The font-family property
- CSS: The font-size property
© 2023 Khan AcademyTerms of usePrivacy PolicyCookie Notice
HTML: The image tag
The
<img>
tag is used to insert images into a page. It has two required attributes:Name | Value |
---|---|
src | The URL of the image. |
alt | A description of the image, used by visually impaired people with screen readers and by the browser if it can't find the image at that URL. |
It has two optional attributes for changing the size, which can also be changed with CSS. If you change the size, try not to squash or stretch the image. It's best to only specify one of them, and let the browser decide the other.
Name | Value |
---|---|
width | The width of the image, either a number (pixels) or a percentage of the page width. |
height | The height of the image, a number (pixels). |