What is XHTML?

A brief definition of the XHTML language that makes us understand what it is, as well as a few of its fundamentals and history.

XHTML is a language similar to HTML, but with some differences that make it more robust and recommended for modeling web pages. The initials correspond to the English words eXtensible Hypertext Markup Language, which in Spanish would come to mean something like extensible hypertext markup language.

In .com we have published a to explain the characteristics of this language, so in this article we simply want to offer an introduction and explain what the main characteristics are.

As we know, HTML has different versions, in which it has changed a lot from the initial idea. The web has grown very fast and has evolved faster than the HTML standards themselves, as needs arise such as the incorporation of video, sound, complex animations, etc. For this reason, the HTML language itself has been surpassed by the needs of companies and developers and has grown many times without attending to the master plan created by the W3C.

XHTML is a return to the past, which tries to recover the line marked by the standards, but which tries to solve various cases of use of HTML, while preparing it to adapt to new needs and technological currents.

The XML Foundation

One of the technologies that has most attracted the attention of the creators of open standards for the web is XML, a markup language that serves as the basis for creating other multidisciplinary languages, which solve many documentation needs of different types of groups in the Internet. new information society.

See also  code editors

XML is a language that also works by tags, just like HTML, but whose document creation rules are much stricter than those of the HTML language itself, which gives rise to the possibility of automatically processing them by computer programs. That small detail is really the basis for a whole series of advantages that make XML an ideal tool for today, where information circulates without limit through global networks and XHTML tries to take advantage of it.

Note: It makes no sense here to try to explain in a few words what XML is, even more so when the manual is available where you will find everything well related.

Therefore, we can say that XHTML is the XML version of HTML. From the developer’s point of view, we will see that XHTML inherits the rigidity of XML, with which XHTML documents cannot be written in any way, as was the case with HTML, but by following some rules. This detail, which at first may seem like a limitation, actually has a series of advantages.

  • Its content can be processed by any computer program (just like XML)
  • Browsers don’t have to go crazy trying to interpret what the developer wanted to write or fix possible code errors, as was the case with HTML.

XHTML as a semantic language

But pay attention to this point, since XHTML is not just HTML with XML syntax. Actually, XHTML incorporates a new conception or, if we prefer, a new philosophy of web page modeling, which seeks to create a semantic web.

HTML has many tags such as FONT, B, I… that express the way an element has to be displayed, that is, they serve to define the appearance of the page contents. In the same way, there are many attributes, such as align, bgcolor, vspace, that also serve to define aspects related to the appearance of the page elements. All of that, with the time of use of HTML and the evolution of the web, has been shown to be incorrect.

See also  learn .NET

Ideally, the people who make a page by writing HTML write the content in a way that expresses what each thing is and not how each thing should look. In this way, the web would be semantic, because only the meaning of each element would be specified and not how it should be displayed.

Note: To define the appearance of the pages, there are other mechanisms and we are referring to the CSS language, which is used to specify how the elements of the page should be displayed, in each of its contents.

XHTML tries to get closer to that ideal, so all the tags and attributes that serve to define the appearance are suppressed and only the tags that serve to define the meaning of each element of the page are left.

For example, the tag is used to define that information is highlighted. It is correct, because it serves to define what that content is (a text to highlight). However, other tags such as B are not correct from the point of view of the semantic web, because they serve to define how a specific text should be displayed (in Bold, bold).

The semantic web allows to separate the content from the presentation and that is something that has been tried for years and a matter that has been put into practice especially in XHTML.

Conclusion on XHTML

Apart from the two theoretical knowledge that we have pointed out in this article (the XML base and the semantic web) that have been implemented in XHTML, in practice there are several that must be taken into account when coding a document.

See also  Declare associative array PHP

We are going to explain all these matters in detail in the present .

Loading Facebook Comments ...
Loading Disqus Comments ...