XHTML mark up: a set of elements with attributes.
Element is an open tag, some content then a close tag.
If no content, element defined by empty tag.
- An open tag consists of:
- Left angle bracket (<) followed immediately by the tag name
- May have one or more attributes (id="3") separated by spaces
- Right angle bracket (>) possibly with spaces before
- A close tag consists of:
- Left angle bracket (<) followed immediately by a slash (/) and the tag name
- Right angle bracket (>) possibly with spaces before
- An empty tag represents both the open and close tag:
- Left angle bracket (<) followed by the tag name possibly with spaces after
- A slash (/) followed by a right angle bracket (>)
-
Attributes qualifies the meaning of an element
- Appear within the opening tag separated by spaces
- Attribute name followed by = followed by text string in quotes (either " or ')
- Cannot mix the quotes (abc="xyz' is not valid)
- Same attribute name cannot appear twice
<title>Title of your document</title>
<hr />
<p class="note">and an <em>enclosed</em> element</p>