Skip to main content

XHTML

XHTML (Extensible Hypertext Markup Language), broadly speaking, is a markup language that allows you to edit websites. It is based on HTML 4.01, but its rules are much more strict and versatile than HTML. XHTML is a new formulation of HTML that uses the XML markup meta language, which is a key advantage in its usability because many data formats are based on XML and modern devices require a strict version of the markup language because they cannot display wrong source code.

General information

XHTML has been designed to extend HTML and allow compatibility with new data formats such as videos, images or scripting languages. Since HTML was always based on SGML and therefore relatively complex, a limited markup target language, such as XML, was found to be adequate for defining the basic structure and syntactic capabilities of XHTML. The XHTML 1.0 specifications were published by the W3C in 2002. At the end of 2009 work on version 2.0 was discontinued because the Hypertext Web Application Technology Working Group (WHATWG) was working on HTML5 at the same time, and this The latter was the one that prevailed in the end.

characteristics

XHTML is used to mark up content such as text, images, and links in the form of hyperlinks to create a certain structure that can be displayed by browsers. Documents can be structured with XHTML to make them parser-readable. The parser interprets the markup items specified in the XHTML language definitions and renders the content of these items in a specific way.

Ultimately, the user sees what these items contain and not how the items are listed or structured. The latter is called XHTML source code and can be edited with different text editors, for example, with a WYSIWYG editor. The notation separates content and design. The content is enclosed by the items. The way this content is displayed is determined by the items and is only displayed by the browser.

Before creating an XHTML document, you must choose a Document Type Definition. There are three types, each with certain advantages and disadvantages, transitional, strict, and frameset. At the same time, the language version must be specified, such as XHTML 1.0 or 2.0. The basic framework of an XHTML file must conform precisely to the rulesOtherwise it is not WFF (well formed formula), which is a valid source code that meets the language requirements and document definitions and can be read by a browser.

The important differences between XHTML and HTML are, for example, the XML declaration, the definition of the document type, which is in lowercase, the exact conformance to the basic framework, and the fact that each open item must be closed again. If one of these rules is not adhered to in XHTML, the browser cannot display the document, which it can probably do with HTML.

Example of a valid XHTML document

 <?xml version="1.0" encoding="ISO-8859-1" ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <title>An XHTML document</title>
 </head>
 <body>
 < h1 >Headline of the first order< /h1 >
 < p >A paragraph with any text content< /p >
 < h2 >Secondary heading< /h2 >
 < p >Another paragraph with any text content< /p >
 </body>
 </html>

Relevance for SEO

When creating websites with XHTML, it is essential to respect the rules mentioned above. Valid source code ensures that these XHTML documents can be read not only in browsers, but also on mobile devices. Apart from this, validity (validity) can have a positive effect on search engines, avoiding invalid status codes. Thus, a correctly registered source code has a certain level of transferability and is certainly also an indicator for search engines. However, HTML5 has replaced XHTML and it remains to be seen to what extent websites that use XHTML will continue to be evaluated positively by search engines.

Web Links