HTML Attributes

HTML Attributes

  • Provide additional information about HTML elements.
  • All HTML elements can have attributes.
  • Are always specified in the start tag.
  • Usually come in name/value pairs like: name="value".

Use Lowercase Attributes

We recommends lowercase in HTML, and demands lowercase for stricter document types like XHTML.

Quote Attribute Values

  • We recommends quotes in HTML, and demands quotes for stricter document types like XHTML.
  • Using quotes are the most common. Omitting quotes can produce errors. We always use quotes around attribute values.
  • 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. Or vice versa. <p title='John "ShotGun" Nelson'>.

Related concepts

HTML Attributes

HTML Attributes — Structure map

Clickable & Draggable!

HTML Attributes — Related pages: