XHTML vs HTML: Key Differences Explained
XHTML vs HTML: Key Differences Explained
XHTML HTML
the documents have to be "good The documents may not be.
formed
XHTML documents must HTML documents may not
to have a single root element of everything to have it
document, the <HTML> element
the non-empty elements (those that have No need
opening tag) must have
closing label
the opening tag of the There should be no closing tag
empty elements must end with " />"
or there must be a closing tag
the values of the attributes must it is not necessary if there are no spaces in
to be written in quotes (double or white
simple)
the references to entities in they can be written in lowercase or
hexadecimals should be written in uppercase
lowercase
the names of elements and attributes It's not necessary
they must be written in lowercase
What is HTML?
HTML is the language used for the development of web pages. This
Language is made up of elements that the browser interprets and the
display on the screen according to its objective. We will see that there are elements
to place images on a page, hyperlinks that allow us
to direct ourselves to another page, lists, tables to tabulate data, etc. In order to create a
HTML page requires a simple text editor (in our case Notepad)
notes) and an internet browser (IExplorer, FireFox etc.), remember that you
You must save the contents of your notebook with the file name followed by
from the HTML extension, we will use the browser that is currently open
you are using (remember that you are currently looking at a
HTML page with your browser
What is XHTML?
It is a language similar to HTML, but with some differences that make it more
robust and advisable for web page modeling. The initials
correspond to the English words eXtensible Hypertext Markup Language
which would mean in Spanish something like extensible language of
hypertext markup.
The original HTML language was very permissive in its syntax, which made it possible
write your tags and attributes in many different ways. The tags for
example could be written in uppercase, in lowercase, and even by combining
uppercase and lowercase. The value of the attributes of the tags could be
indicate with and without quotes ("), also the order in which they were opened and closed
tags were not important. The flexibility of HTML may seem like an aspect
positive, but the final result is pages with messy HTML code,
difficult to maintain and very unprofessional. Fortunately, XHTML solves
these problems adding certain rules in the way of writing the labels and
attributes.