Forum Moderators: open
<!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>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
Out of interest I checked my test page, which validates as XHTML 1.0 but I'm not exactly sure what I'm doing here. I know nothing about XHTML and was thinking of validating as HTML, not XHTML. For example when I use target="_blank" for a link, the page no longer validates as XHTML but I think would validate as transitional HTML. What is the difference, and what should I be going for?
Since I've a bit of time on my hands for a couple of weeks, I'm interested to maybe modernise my approach to page design but not sure where to begin.
XHTML is significantly better than HTML, as it encourages good practice. Where it doesn't allow things that HTML does, it's likely there's a good reason.. for instance not using target="_blank", these things then in turn impact on the sites accessibility, consistency, SE performance etc etc.
Even if you don't use valid XHTML it's worth validating to Strict where you can.
That said the headers like these are more a declaration of intent so if you do have a few errors it shouldn't matter.
It may be that you can jump into coding valid XHTML. You might however find it less frustrating starting with sloppy HTML and validating 4.01 transitional, then 4.01 Strict then XHTML 1.0 Transitional, then XHTML 1.0 Strict.
XHTML 1.1 is where the rules become much more stringent.
This involves <?xml version="1.0" encoding="iso-8859-1"?> and xml+xhtml MIME headers which switch the browsers into strict mode and do not allow them to compensate for sloppy coding.. that is the page falls over with errors!
Without these XHTML is treated as HTML and the browser will compensate for errors. Different browsers thenin interpret intention differently and sometimes display pages differently.
For now I'd suggest getting HTML 4.01 Strict, before worrying about serving up XHTML, but would suggest XHTML is well worth doing if you have time.
dpb
I started with 4.01 transitional. There were tons of errors, but mostly the same ones over and over again. Pretty quickly I tried for strict. There were only a few errors at this point. A little advice from the folks here on a couple points - and I never looked back.
Lately, I've had XHTML 1.0 on my mind.(Don't know why - I don't really need it.) After reading your post, I fired up the W3C and ran two pages through it. Each had just a few errors, and was validated in just a couple minutes. The jump, for my first two pages at least, was almost effortless.
----davidpbrown----It may be that you can jump into coding valid XHTML. You might however find it less frustrating starting with sloppy HTML and validating 4.01 transitional, then 4.01 Strict then XHTML 1.0 Transitional, then XHTML 1.0 Strict.----
He's right about that. If you're starting with pages of questionable construction, ease your way in and get a feel for what each jump will require. Had I started with XHTML 1.0, it likely would have been unmanageable.
There was only one (but substantial) hang up. I was rocked with meta errors, but whittled my way down to 0. Can someone point me to the best places to educate myself on metas in general, and for XHTML in particular? I recall a recent discussion on the value of using some of them at all. Clearly there is a need for me to get some more education on metas, which is lacking, and showing. I'd like to be more efficient in their use.
For an introduction to XHTML see [w3schools.com ]
For allsorts of other introductions to the like of CSS, PHP, XML etc see the w3school home page.
For meta tags you could start here [searchenginewatch.com ]
The difference in XHTML is that the <meta> tag must be properly closed.
eg.<meta name="description" content="XHTML tags" />
dpb