Creating sites in XHTML, which means quitting HTML
XHTML 1.1 is at present an obligatory version of HTML language, but – unfortunately – the reality shows us that it is completely different, due to the fact that international group of
W3C
doesn’t really have any influence to Internet sites webmasters and only creates those standards and presents them as their recommendation. My job is not to present you all the advantages of using standards and documents in
XHTML compatible with them. I believe you are already confirmed about that if you read this article. If not – you’ll be so soon.
At the beginning, let me accept the fact that you have already been acquainted with HTML
language and you can create a site using it. If not, you should first use one of the HTML courses, which are widely located in all the net.
Let’s start with the document’s beginning, a prologue which should look as follows:
<?xml version=”1.0″ encoding=”utf-8″?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”pl” lang=”pl”>
We have to remembar that the document will have PHP extension, therefore we will be using php language. The first verse of the declaration should be substituted with:
<? print(”<?xml version=\”1.0\” encoding=\”utf-8\”?>”);?>
The declaration mentioned above is compatible with Polish language and UTF-8 coding, which are the only corresponding ones, according to XHTML 1.0
You will find more about UTF-8 coding at Unicode You will find more about UTF-8 coding at .
Another very important aspect is a fact of enclosing all the tags. Therefore, apart from the HTML
there are no open tags here. This refers to the following tags: <meta>; <br>; <img>; …
which should be: <meta/>; <br/>; <img/>; …,
I obviously omitted some of the other elements of these tags..
Next essential fact is that every single image should have alt=”” attribute. It can remain empty of course, but it is ‘worth’ to describe pictures. I believe these are all the most important tags changes.
There is also another very important (if not essential) element – it’s the displacement of all the site’s layout to the
CSS. style sheet. This means we will have to forget about describing font styles using
<font> tag. In XHTML
language, all the information that refer to the layout change had been moved to the style sheet
CSS. We can attribute them to
XHTML document with three different methods: attributing style to a tag, e.g.
<body>, creating a class called .class and later attributing it to some tag, e.g.
<div class=”class”> or making a descriptor (identifier) .identifier and attributing it later to some tag, e.g.
<div id=”identifier”>. The difference between a class and an identifier is that we can attribute class to several tags in one document, while identifier can be attributed only to one. If you’d like to get more information on
CSS
styles, please see the recomendation or different courses.
The last change refers to the fact that the appropriate XHTML document should have its content distributed into divs and not the tables. According to the standards, the tables can only be used to putting there the content and not the site’s layout.
Building sites in divs is a wide topic so I will describe it more clearly and widely in my next article..
If you have already used one of the rules mentioned over, you can validate.
I hope that my article helped you to pass it at once!

nauczylem sie bardzo wiele