You've learned how to add images to a web page using the
<img> element and the
background property. What's the difference between these two methods? When should one method be used over another?
The method used depends on the type of image.
Some images are part of the content of a web page (icons, logos, album photos, etc.) and they communicate important information to a user. Other images are intended simply to style a web page (header backgrounds, etc.), not to communicate important information.
When an image communicates important information, you can use the
<img> element and style the image using CSS, if needed.
When an image is intended to style a web page, you can use the
background property and further style it with CSS.