Creating an HTML Document
Marking Elements with Tags
- The core building block of HTML is the tag, which marks each element in a document.
- Tags can be two-sided or one-sided.
- A two-sided tag is a tag that contains some document content. General syntax for a two-sided tag: <element>content</element>
- A two-sided tag's opening tag <p>and closing tag </p> should completely enclose its content.
- HTML allows you to enter element names in either uppercase or lowercase letters.
- A one-sided tag contains no content. General syntax for a one-sided tag:
- Elements that employ one-sided tags are called empty elements since they contain no content. An example is a line break <br />
- A third type of tag is the comment tag, which you can use to add notes to your HTML code. <!-- comment -->
- Comments are useful in documenting your HTML code for yourself and others.
White Space and HTML
for two-sided tags
The Structure of an HTML File