HTML documents are defined by HTML elements. The HTML element refers to all the code from the start tag (start tag) to the end tag (end tag).
Start tag |
Element content |
End tag |
<p> |
This is a paragraph |
</p> |
<a href= "default.htm" > |
This is a link |
</a> |
<br/> |
|
|
3.1 HTML element syntax
①html element starting with start tag
②html element terminated with end tag
The content of the ③ element is the content between the start tag and the end tag
④ some HTML elements have empty content
⑤ empty elements are closed in the start tag (ends with the end of the start tag)
⑥ most HTML elements can have properties
3.2 Nested HTML elements
① Most HTML elements can be nested (other HTML elements can be included).
②html documents are composed of nested HTML elements.
Instance:
The above example contains three HTML elements. <p> element;<body> element;
3.3 Note
① future HTML versions do not allow the end tag to be omitted.
② HTML elements that have no content are called empty elements. The empty element is closed in the Start tab. <br/> is the empty element, the self-closing and the label.
③ all elements must be closed.
④html tip: Use lowercase tags
HTML Learning Document-3, HTML elements