HTML Attributes
Common HTML attributes are applicable to many or most HTML elements. These HTML attributes allow additional setting of style or other characteristics to the element. The HTML attributes outlined on this page are common in many HTML elements.
ID attribute
Used as a unique identifier for elements for style sheets. In HTML page:
<hr id="firsthr">
In style sheet:
hr#firsthr { color: #80b0ff; height: 15; width: 100% }
CLASS attribute
Used to specify similar attributes for dissimilar elements by putting them in the same class. In HTML page:
<p class="indent">
In style sheet:
.indent { margin-right: 5%; margin-left: 5%; color: #0000ff }
STYLE attribute
Used to set various element attributes to specific values. Example:
<h1 style="text-align: center">Common Attributes</h1>
TITLE attribute
A tool tip on visual browsers.
|