HTML

Last Updated: 9/15/2022

Html Attributes

  • HTML elements can have attributes
  • Attributes provide additional information about elements
  • Attributes are always specified in the start tag
  • Attributes usually come in name/value pairs like: name="value"
  • Always Use Lowercase Attributes
  • Double quotes around attribute values are the most common in HTML, but single quotes can also be used.
  • In some situations, when the attribute value itself contains double quotes, it is necessary to use single quotes
  • Boolean attributes are attributes without values. Boolean attributes can only have one value which is generally the same as the attribute name.

Example

<a href="https://www.google.com">Visit Google</a>

<img src="sky.jpg">

<input type="text" disabled>

<input type="text" disabled="disabled">