cancel
Showing results for 
Search instead for 
Did you mean: 

HTML 4.0 or XHTML 1.0

shutter
Community Veteran
Posts: 22,218
Thanks: 3,777
Fixes: 65
Registered: ‎06-11-2007

HTML 4.0 or XHTML 1.0

I have started to re-vamp my website, and add some new photographs. I also want to re-design and re-word the Home Page, and others. To assist me, I have downloaded a Text to HTML converter, which is real easy to use, and in the "preview" versions of my new pages, seems to work very well and do a good job.
HOWEVER... I have noticed I have a choice of formats for the html.... either HTML 4.0 or XHTML 1.0
Please can anyone advise me which is the correct/best one to use?
Thanks
2 REPLIES 2
mal0z
Grafter
Posts: 3,486
Registered: ‎02-10-2008

Re: HTML 4.0 or XHTML 1.0

This could  generate quite some debate 🙂 - some will say that XHTML is more modern and will allow change to XHTML 2 ( when / if it comes ) willbe easier ) . Some like it becuase it looks tidier, enforces you to close tags .
The World Wide Web Consortium - who control html/xhtml recommend using XHTML.
Supporters of html 4.0 - say it's just not necessary and it doesn't work any better.
Looking at sites, you see some just use a confusing mixture of the two.
Personally - I'm pragmatic and have use XHTML for about 4 years , as I prefer it, it looks neater, haviing to close tags helps illiminate silly errors.
But more importantly it enable me to use the http://validator.w3.org/ - which helps enormously sorting out errors, but make sure that every page has the following as the top couple of  line of the file:
<!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">
<head>
you could use :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

note the strict - but I've been recommended to use transitional as it is a more linient on allowing some features which are due to be dropped.
You might find it useful to find a utility to convert all your files from html to xhtml, I can't recommend one as I use Dreamweaver, which has such a too built in.
But as I said - you may get some styrong arguments from either side - it can generate fierce debate.
I'd be interested to see the html generated by this text to html convertor !. Persoanlly I prefer to use plain ascci text - unformated and the use <h1>,<h2> <em) et etc and control the text with css - but if you haven't learnt much code yet that may take a little learning, but in my view is well worthwhile as you can control the appearance so much better.

Just don't ever use MS Word to generate html - it creates bloated, non standard and horible cod, which is then difficult to mainttain.

shutter
Community Veteran
Posts: 22,218
Thanks: 3,777
Fixes: 65
Registered: ‎06-11-2007

Re: HTML 4.0 or XHTML 1.0

Thanks for the reply... I half guessed it would generate some debate, but the text I am using is for my "home page intro", which sits "inside" my Jalbum software, which actually produces the site layout.... I use the text/html converter for the text layout on the page, and also to add in the links to other sites automatically, as I really do not know or understand how html works,
As for "neatness"... I never see it (apart from this kind of exercise) so how it looks,  is of little importance to me, the main thing is if it works on the website ! !..
Yes, I know about MS Word and MS Publisher ... I originally used that for my site, then managed to get Jalbum working, and the site was less than half the size with twice as many photographs !
If you want to see what it can do, and how easy it is to use ! google for Easy Text to HTML converter Version 3.0.0 build 057
or go to http://www.easyhtools.com ;   (As with most of my software------------- It is FREE ! ! ! )
Cheers