There are 14 HTML tags that do not need to be closed: No content tags:
,
, , , , , < ;noframes> Text-only tags:, , , Special tags: , , ,
Which HTML tags do not need to be closed
HTML tags are used to define the elements and structure on a web page. While most HTML tags come in pairs and require a start tag and a closing tag, some tags do not require closing.
The following are HTML tags that can exist independently:
No content tag
: Line break
<li>: Horizontal line
<li>: Image
<li>: Form input field
<li>: Style sheet link
<li>: Metadata
<li>: Non-frame content
Tag containing only text
: Base URL
<li>: Browser command
<li>: Key generator
<li>: Plug-in parameters
Special tags
<li>: HTML root element
<li>: Contains the document header Information
<li>: Contains the document body content
Some HTML tags do not need to be closed in some contexts. For example,
<th>
, and <li>
can be used without closure in tables and lists.
HTML5 introduced many tags that do not need to be closed, such as <footer>
and <nav>
.
The above is the detailed content of Which html tags do not need to be closed?. For more information, please follow other related articles on the PHP Chinese website!