HTML Attributes

What is an HTML Attribute?

inline

  • Attributes provide additional information about the contents of the an element.

  • They are placed in the opening tag

  • They have two parts: name, value


Attribute Structure

  • Attribute Name

    • Indicates what kind of extra information you are supplying to the browser about the content in the element characters within the brackets indicates the tags purpose
  • Attribute Value

    • Information or setting for the attribute
    • Is placed in double or single quotes

Example of a HTML Attribute


 <img src="mdn-logo-sm.png" alt="MDN">


A complete list of all the available HTML attributes can be found here