IIC 1: Tag Structure

A tag is what defines how text, graphics, and other data is displayed on a website. The format is simple; an opener, <, the name of the tag, attributes and values, and the closer, >. Most tags have an option to put data between the opening and closing. The format is like this: <tag attribute="value"> internal data </tag>. Although technically <TAG attRIBute="value"> internal data </tAG> works, it is now standard for all tag and attribute names to be lower-case.

Example:
<div class="colorful">Internal data</div>
<img src="image.gif" style="height:300px;width:150px;" />
Explanation:
The first tag is a Div tag. This is a container for text. Its class is set to "colorful", which has to do with CSS. Between the opening tag and the closing tag (the </div> is the closing tag) is the text that gets displayed on the page.
The second tag is a basic image tag. It's source (src) is set to image.gif, which would be the location of the image. The style attribute is set to give the image a height of 300 pixels and a width of 150 pixels. The image tag and CSS (style) will be delved into at greater length later in the course. Because this type of tag does not have a closing tag (</img>) the end of the tag ends with />