HTML Essential Training

Formatting page content

In this series of exercises, we'll explore how to use HTML elements to format basic page content.

Inserting images

Lowcountry South CarolinaImages are placed on the page through the use of the img tag. Images are considered replaced content, that is the element is replaced with the asset it references. The image element has several important attributes. The src attribute is used to tell the browser where to find the image. The alt attribute allows you to pass along descriptive text representing the image. This can be used by screen readers, or displayed in the event the image fails to load.The width and height are optional and can be used to pass the dimensions of the image to the browser. If omitted, the browser will still display the image at its native width and height. These values can be changed to force the browser to size the image differently from it's native size.

South Carolina flagMost browser support a wide range of image types. For the most part, you're safe using jpg, png, gif, bmp, and svg image formats.

Insert a new image beside this text.