HTML Attributes

Attributes provide additional information about HTML elements. They are placed within the opening tag of an element and are specified as key-value pairs.

Common HTML Attributes:

  • src: Specifies the source of an image or a link.
  • alt: Provides an alternative text description for an image.
  • href: Specifies the destination URL of a link.
  • target: Specifies where to open a link (e.g., in the same window or a new tab).
  • class: Assigns a class name to an element for styling purposes.
  • id: Assigns a unique identifier to an element for JavaScript manipulation.

Previous     Next

Use the Search Bar to find content on MarketingMind.