Add Images to Your Website
Summary
- Images can be added to a website using the
img
element. - The
src
attribute is used with the img
element to point to a specific image’s URL. img
elements are self-closing - This means you do not need to include a closing tag (
</img>
)
img
elements must include an alt
attribute. - The text inside an
alt
attribute is used for screen readers to improve accessibility and is displayed if the image fails to load. - If the image is purely decorative, using an empty
alt
attribute is a best practice.
Final Code