Prev Next

Attributes

Attributes are required to add more information to the tags for e.g setting the colour , background etc.

Key points about an attribute

  1. They always appear in the start tag and will never be a part of the end tag
  2. More than one attribute can be specified for a single tag
  3. The attribute is made up of  three parts : they are Name, equal to sign (=) and value
  4. There are some attributes that can be used with  all tags but will have no effect on some. Such attributes are called global

Example of attribute

<a href="https://www.google.com">Visit Google</a>
  1. href :Is  the attribute name
  2. =: it’s a assignment operator and is a must
  3. “https://www.google.com : is a value and will change based on the Attribute name. Value always needs to be enclosed in quotation marks