XHTML
XHTML, or Extensible HyperText Markup Language, is a stricter, XML-based version of HTML used for creating web pages. It combines the structure of XML with the display capabilities of HTML, requiring a more strict syntax, such as all tags being lowercase and properly nested, to ensure backward and future compatibility and consistency.
Key features
XML-based: XHTML documents must follow the rules of XML, which makes them well-formed and easier to process with XML tools.
Stricter syntax: Unlike HTML, XHTML has strict rules that must be followed: All tags must be written in lowercase. Elements must be properly nested. Elements must always be closed, including empty elements. Attribute names must be in lowercase. Attribute values must always be enclosed in quotes.
Compatibility: XHTML was created to help developers transition from HTML to XML while ensuring compatibility with both old and new browsers.
Root element: Every XHTML document must have a root html element, with head and body sections inside it, similar to HTML.
DOCTYPE declaration: An XHTML document must include a !DOCTYPE declaration that specifies the Document Type Definition (DTD) to ensure proper rendering.