Most HTML tags can have what are called attributes. There are many types of attributes and some are required while others are not. They always follow the same format.
Attributes modify or add meaning to an HTML element.
Attributes follow a relatively simple format
<tag
attribute-name="attribute-value"
>Some content...</tag>
href
, title
, class
, src
, etc.The img
element is used to insert images into an HTML document. It is an empty tag (meaning it has no closing tag).
The img element has two required attributes:
alt: The alternate text.
This is used to describe the image for someone who cannot see it because they are either using a screen reader or the image src is missing. This text will only show if the image does not.
Things to remember:
id
and class
img
and a
.