HTML Nomenclature

Are there terms for HTML tags that distinguish between those that should have end tags and those that should not?

For example, <em>and <a>must be followed by </em>and </a>.

On the other hand, <br />and <img ... />you do not have to.

What is called the first group, and the second?

+3
source share
4 answers

I believe that it <foo />is an "empty element", unlike ... not; -p btw, is <br />not an html element - it is an xhtml element. IIRC is supposed to be <br>in true obsolete html.

+7
source

XHTML . , , , . , content ( ). .

, .

+5

, HTML 4.01 (, <p> <li> ) , .

:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Title</title>
</head>
<body>
<p>Test
</body>
</html>
+1

HTML 4.01 , .

  • , . . <h1 > </h1 >
  • , . . < & Li GT;
  • , . . < & GT; - W3C HTML 4.01 < br/ >

, .

"" , . 1 2 .

My suggestion: although the W3C says nothing about this, as far as I can tell, one could refer to elements such as <br> as “ space elements ”, since they are considered white space and they are elements. "Symbols of white space", such as, are not elements, so there should be no confusion. Does anyone see a problem with this? If not, perhaps we should make a proposal to the W3C.

+1
source

Source: https://habr.com/ru/post/1707082/


All Articles