HTML Attributes

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 role of classification and identifying elements will become more apparent as your learn 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 tag) but want them to be different in appearance.

Attribute Example
HTML text formating are defined with the <font> tag.
<font color="red" size="+1">HTML text formating are defined with the <font> tag.</font>
HTML text formating are defined with the  tag.

Always Quote Attribute Values:

Attribute values should always be enclosed in quotes. Double style quotes are the most common, but single style quotes are also allowed.


Jared Drake said...

Good example, but I think you need to go into more detail about the types of HTML attributes and exactly how the relate to the parent element

Post a Comment