HTML Attributes (3)
HTML – Attributes
Attributes are used to amplify tags. At some point you may want to give your body element a background color or perhaps change the width of a table. All of these things and more can be achieved using Attributes.
Many HTML tags have a unique set of their own attributes. Right now the focus is on a set of generic attributes that can be used with just about every HTML Tag in existence. Attributes are placed within the opening tag and they follow a precise syntax (format).
HTML – Class or ID Attribute
The class and id attributes are nearly identical. They play no direct role in formatting your elements but rather serve behind the scenes for scripting and Cascading Style Sheets (CSS). The idea is that you can classify or id certain a tag and later format the tag using Cascading Style Sheets. It becomes necessary when you have two or more of the same element on a page (like a <p> tag) but want them to be different in appearance.
HTML Code:
<p id="italicsparagraph">Paragraph type 1 Italics</p> <p id="boldparagraph">Paragraph type 2 Bold</p>
Classification Attributes:
Paragraph type 2 Bold
HTML – Name Attribute
Name is much different than id and class. By allotting a name to an element, that name becomes a scripting variable for scripting languages such as Javascript, ASP, and PHP. The name attribute is seen most often with forms and other user-input elements.
