The HTML Tag
The HTML tag is the essential element in HTML. Every HTML tag is made up of < (an opening angle-bracket), > (a closing angle-bracket), and a tag name. Many tags also contain an attribute and its value. (Don't trip over the "attribute-value" language just now, we'll cover it in the next paragraph and the next page.) The HTML tags give the browser instructions for what a Web page is supposed to look like--the appearance and function of the content (text and graphics).
Generally, the tag name is an abbreviation for the tag's function. For example, the tag to make a paragraph is:
<p> text </p>
Attributes are added within a tag to extend or modify the tag's function. For example, <span> is a tag that sets aside a piece of text so you can make changes to it. The attribute style can be added to change the size of the font:
<span style ="font-size:12px">text</span>
Most attributes are equal to a value, which is the part that follows the equal sign. In the example above, the tag is <span>, the attribute is style and the value is "font-size:12px". The value establishes to what degree the attribute is represented. The value should always be enclosed in quotation marks. (This is optional in the current HTML specifications, but it's required for more advanced things like Extensible Markup Language (XML). Might as well get in the habit of doing it right now.) A single tag can have multiple attributes, but each attribute can only be repeated once:
<body text ="black" bgcolor="blue">text</body>.
<tagname attribute ="value">