Hi
I know that many books (I bought a few) think that xhtml plus CSS is the
way to go. But in the real world what are people using on websites? For
the one person shop is there any advantage to learning/ using xhtml?
xhtml has no advantages and several minor disadvantages compared to html4.
The idea was "let's publish a more-or-less identical standard but this
time tell browser developers that they must refuse to display pages that
are not well-formed". Mozilla even did that for a little while!
When Microsoft decided not to do the same in Internet Explorer they dealt
the kiss of death to xhtml, and really the w3c should have known that
that would happen.
The net outcome of the whole affair is that a lot of people now put
superfluous slashes in their br element tags.
From your point of view as a prospective designer there is no
particularly big reason not to use xhtml.
Personally I like being able to implicitly close my paragraph elements,
(omit </p>). Perhaps you might feel the same, or you may feel that it is
easier to close every element explicitly. If you use xhtml you are saved
from learning which tags are forbidden or optional, but you have to do a
tiny bit more typing.
The features and usefulness of the two are completely identical in the
real world, your users will not be able to tell the difference.
The following doesn't really affect your decision, but you may be
interested: xhtml is a massive pain in the arse to browser developers,
or anyone who has ever tried to write programs to get information out of
web pages. (I have in several languages). Some of the problems are:
- Parsing xml is not difficult, (it is trivial), but many idiot
developers think that it is cool to put a few xml empty element tag
slashes in their pages. Not all the way through, mind, just a few.
- Changing the content model of elements like script makes it quite
complicated to put any content in them at all (I recommend only ever
using external scripts and styles) and this makes it pure guesswork to
try to get any information out of them.
- The fact that xml is not up to the job of html means that after you
parse a table in xhtml you then have to piss around with the tree
putting the tbody in, which would have been implied by an sgml parser.
My only real advice is to pick one, learn it well, and stick to it
consistently.
HTH
viza