## The element refers to all code from the start tag to the end tag .
Start (open) tag
Element content
End (close) tag
this is my web page
## An HTML element without content is called is an empty element. Empty elements are closed in the opening tag.
is an empty element without a closing tag ( tag definition wraps).
In XHTML,
XML
, and future versions of HTML, all elements must be closed. Adding a slash in the opening tag, such as , is the correct way to close an empty element, and is accepted by HTML, XHTML, and XML.
Even though is valid in all browsers, using is actually a longer-term guarantee.
HTML element syntax
## The content of element is the content between the start tag and the end tag
Empty elements are closed in the opening tag
Most HTML elements can have
attributes
Nested HTML elements
Most HTML elements can be nested
<p>Hello world, <a>找度娘</a></p>
Copy after login
HTML attributes 1. Tags can have attributes to provide more information for elements
2. Attributes appear in the form of key-value pairs, such as: href = "www.cnblogs. www/winsoncheung" 3. Commonly used tag attributes:
The above is the detailed content of HTML5 study notes (2) - detailed introduction to elements, attributes, and formatting. For more information, please follow other related articles on the PHP Chinese website!
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn