Chapter 4: Attributes

Hazaifa
0




HTML elements can also have attributes, which provide additional information about the element. Attributes are added to the opening tag of an element and are used to define the properties of the element.


For example, the <img> element can have a src attribute that defines the source of the image:


<img src="image.jpg" alt="My Image">

In this example, the src attribute defines the source of the image as "image.jpg", and the alt attribute provides a text description of the image for accessibility.

Post a Comment

0Comments
Post a Comment (0)