HTML Tutorial – 17 – XHTML


XHTML or Extensible HyperText Markup Language
is the successor to HTML. It’s a reformulation of HTML using XML and is therefore almost
identical. However, XHTML is stricter so there are a few differences that we need to look
at. First, XHTML requires all elements to be closed.
So previous optional end tags must be included and elements that does not have an end tag
gets one in the start tag by adding a forward slash. Secondly, XHTML is lowercase-only for all
tag and attribute names. And all attributes must have a value specified.
For attributes that don’t have any values this means that they must use their own names
as their value. Also, double quotes are required around all values. It’s recommended that we specify an XML namespace
using the xmlns attribute. By placing this attribute within thetag we decide
the namespace used throughout the document. This attribute can be placed within any element
to define one or more alternative namespaces within our document. There is also an optional line that we can
place at the first line of the document. This XML directive tells the browser that we are
using the current version 1.0 of XML along with the common 8-bit Unicode character set.

Be the first to comment

Leave a Reply

Your email address will not be published.


*