What is a HTML Attribute?

A HTML Attribute provides additional information about the data within the HTML Element, or the HTML Element itself, it could be used to define a layout on the web page for the HTML Layout itself or define how to display the HTML Element. The HTML Attribute is always placed in the start tag. An Example being;

<div class=”title”>Hello World<div>

The HTML Attribute here is class. Class is an attribute with the value of title. Class is used as a reference to an entry in the Cascading Style Sheet ( CSS ) that will define how to display the HTML Element containing Hello World.

The HTML Attribute is a name value pair, which means that in the above example ‘class’ would be the name and ‘title’ would be the value.

HTML Attributes are case insensitive. But it is recommended that all HTML Attributes and their values are lower case.

This is due to the fact that W3C recommends lowercase in it’s HTML 4 specification.

Related Articles Link
W3C HTML 4 Specification http://www.w3.org/TR/REC-html40/