HTML Tutorial - HTML Attributes


Attribute is very important part of HTML. These Attributes are part of many HTML Tags, used to provide differnt effects on the text content of the webpage. Attributes are part of the opening Tag always. It is usually in name and value pair like name = "value".

HTML Example for Font
Source: Result:



We have used font tag in the example shown above.
There are two attributes with name "face" and "color".
The "face" attribute is used to set the font face, here it is "arial".
The "color" attribute is used to set the font color to the text content, here it is "blue" and "green".

Note: The attributes name and value must be in lowercase.
World Wide Web Consortium (W3C) recommends lowercase attributes in their HTML 4 recommendation.

HTML Attribute Reference


Shown Below is list of HTML Attributes that can be used in nearly all the HTML Tags.

Attribute
Description
id
Using this attribute we can uniquely identify any Tag.
title
Using this we can provide an tooltip text for any Tag.
class
Used to reffer to class names available in style sheet. Will learn more about style sheet in CSS Tutorial.
style
Used to put CSS style for Tags.