Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Whether the html tag is closed or unclosed

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "the html tag is closed or not closed". In the daily operation, I believe that many people have doubts about whether the html tag is closed or not closed. The editor consulted all kinds of data and sorted out a simple and easy-to-use method of operation. I hope it will be helpful to answer the question of "html tag is closed or not closed". Next, please follow the editor to study!

No content element (Void elements)

A content-free element is a special element that cannot contain any content. Other elements, for example, can not contain any content, but can also contain another element or text.

The more common content-free elements are:

Less common content-free elements are:

These are all the existing content-free elements.

Such writing is illegal for HTML because it implies that br can contain content (but

Hello! Is completely meaningless. And

And both are common.

Although we all know that XHTML forces you to write, there is no explicit rule in HTML.

Trace back to history

In order to fully understand the content-free element, it is necessary to understand its history.

HTML, XML and XHTML are all based on SGML. The full name of SGML is "Standard Universal markup language", which was drafted in 1986.

Both HTML and XML are derived from SGML, where XML is a constrained subset of SGML and XHTML is based on XML.

XHTML is basically the same as HTML, but based on XML.

With this relationship in mind, let's move on to the most interesting part of this article.

SGML has a feature called "NET,Null End Tag". When there is only simple text in the tag, there is no need to close the tag by using a tailless tag. For example, you can write Quoted text as. )

Then, tags that do not contain anything can be written as

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report