Well-formed element

From Free net encyclopedia

In web page design, and generally for all markup languages based on SGML, such as HTML, XML, a well-formed element is one that is either

  • opened and subsequently closed,
  • an empty element, which in that case must be terminated,

and at the same time also is

  • properly nested so that it does not overlap.

For example, in HTML: <b>word</b> is a well-formed element, while <i><b>word</i> is not, since the bold element is not closed. Empty elements (tags without text in between) can be closed by putting a slash at the end of the tag, i.e. <img />.

Template:Web-stub