#1
|
|||
|
|||
HTML Elements
HTML documents are defined by HTML elements.
HTML Elements An HTML element is everything from the start tag to the end tag: Start tag * Element content End tag * This is a paragraph This is a link* The start tag is often called the opening tag. The end tag is often called the closing tag. HTML Element Syntax
Nested HTML Elements Most HTML elements can be nested (can contain other HTML elements). HTML documents consist of nested HTML elements. HTML Document Example This is my first paragraph The example above contains 3 HTML elements. Example Explained The element: This is my first paragraph The element defines a paragraph in the HTML document and an end tag The element content is: This is my first paragraph The element: This is my first paragraph The element defines the body of the HTML document The element has a start tag and an end tag The element content is another HTML element (a paragraph) The element: This is my first paragraph The element defines the whole HTML document. The element has a start tag and an end tag The element content is another HTML element (the body) Don't Forget the End Tag Most browsers will display HTML correctly even if you forget the end tag: This is a paragraph This is a paragraph The example above will work in most browsers, but don't rely on it. Forgetting the end tag can produce unexpected results or errors. means the same as . Plenty of web sites use uppercase HTML tags in their pages. Similar Threads:
|