14 replies [Last post]
SuperRoach
SuperRoach's picture
Offline
Enthusiast
Ballarat
Last seen: 11 years 4 weeks ago
Ballarat
Timezone: GMT+10
Joined: 2007-02-26
Posts: 291
Points: 6

after putting off cleaning up the code and not paying too much time to the doctypes i'm using, I've decided to go reverse and keep it in mind Tongue

Now a simpl(ish) page here:
cressaid.com.au/clients/albins/contactus.html

Has a custom navigation menu, a form styled with css, and some other basic things.

When I validate the html, I get a lot of errors, which mainly refer to the META tags, and the form itself. The meta tags im a bit confused on, for example this meta tag is wrong in the validator:
<META NAME="keywords" CONTENT="Bunch of keywords here" />

Main points I picked up from the validator:
Meta tags are wrong
Form isn't defined correctly

A side effect that I think is caused by all this is that safari doesn't even bother to read the css styles I have for it - it appears in raw html form.

The doctype I am using is:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

What do you think - should I try falling back to a HTML4 transitional type tag, or keep going for the stricter XHTML doctype?

Triumph (not verified)
Anonymous's picture
Guru

lowercase "meta".

Lowercase tags and attributes. What's the reason for using XHTML 1.1? Are you serving it as application/xhtml+xml?

SuperRoach
SuperRoach's picture
Offline
Enthusiast
Ballarat
Last seen: 11 years 4 weeks ago
Ballarat
Timezone: GMT+10
Joined: 2007-02-26
Posts: 291
Points: 6

The tags are lowercase, but

The tags are lowercase, but i wasn't aware the attributes had to be lowercase too. Fixed them up and revalidating now

There isn't a specific reason why it has to be xhtml, really... so for cases like this, would it be better to "downgrade" the doctype I have?

Triumph (not verified)
Anonymous's picture
Guru

SuperRoach wrote:There isn't

SuperRoach wrote:
There isn't a specific reason why it has to be xhtml, really... so for cases like this, would it be better to "downgrade" the doctype I have?

I think you have a bit of a misconception in this case. A doctype is simply a set of rules that you are telling the browser viewing your page that you are following. I wouldn't say changing the doctype is an upgrade or a downgrade, just a different set of rules.

XHTML is a current standard. If it is a new page use strict as transitional is sort of a middle ground for pages that were updated (usually from no standards to some form of standards compliance).

XHTML 1.1 must be served as application/xhtml+xml if you are serving text/html then stick with XHTML 1.0

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 39 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

DTD's *sigh* big muchness of

DTD's *sigh* big muchness of pain do they bring.

Really and truly only those that understand the true arguments why using xhtml of any flavour served as text/html is pretty much a nonsense should use it and then of course a logical conundrum is introduced.

The thing about the document declaration is that it is largely irrelevant, browsers settled on using it as a convenient piece of code that they could use to establish a sort of if/else conditional rule. If a DTD of the right sort was declared then the UA would switch to 'Standards Mode' if it wasn't then browsers would revert to 'Quirks Mode' rendering but it's not something that the DTD itself does nor does the browser make use of the declaration other than in this manner, although with a system identifier (the url) it can know where to find a copy of the rules if it needed to.

The DTD is however used by the online validator as a means of understanding what rules the page is intended to conform to and if it's not in place then the validator sniffs and makes up it's own mind as to what it thinks the document code resembles and validates against that.

Honestly and truly? we should be using html 4.01 strict.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Ed Seedhouse
Ed Seedhouse's picture
Offline
Guru
Victoria British Columbia
Last seen: 1 year 33 weeks ago
Victoria British Columbia
Timezone: GMT-8
Joined: 2005-12-14
Posts: 3570
Points: 675

Hugo wrote:Honestly and

Hugo wrote:
Honestly and truly? we should be using html 4.01 strict.

Hear, hear!

Ed Seedhouse

Posting Guidelines

Watch out! I am carrying irony, sarcasm and satire, and know how to use them.

SuperRoach
SuperRoach's picture
Offline
Enthusiast
Ballarat
Last seen: 11 years 4 weeks ago
Ballarat
Timezone: GMT+10
Joined: 2007-02-26
Posts: 291
Points: 6

Hugo wrote:Honestly and

Hugo wrote:
Honestly and truly? we should be using html 4.01 strict.

Agreed Smile Thanks for your help guys.

Smee
Smee's picture
Offline
Elder
Adelaide, Oz
Last seen: 5 years 15 weeks ago
Adelaide, Oz
Timezone: GMT+9.5
Joined: 2007-06-10
Posts: 1596
Points: 340

Hugo wrote:Honestly and

Hugo wrote:
Honestly and truly? we should be using html 4.01 strict.

@Hugo....{Mwah} Thank you. Thank you. Thank you!!!

Why? For just saying it straight and out loud and at last making me comfortable with a DTD decision.

I volunteered to learn to rewrite a website (yeah, I know... my first mistake) because I thought, you know, it would be a good thing to learn so why not? It would keep me off the streets. I started with a 4.0 Transitional, moved to XHTML when all the sites I was looking at code for help seemed to specify it, then read the pointer someone here sent me to only to scare me out of what wits I had left and back to 4.01 Strict. What with all the googling, stripping, rewriting and validating, I haven't seen the streets for months. Sad

I've been reading the forum for weeks. I've followed pointers and links all over the place, sometimes to learn, sometimes for curiosity, sometimes to bookmark for later, sometimes just for the hell of it. Sometime soon I'll even get back to my "exercise" Smile

I read this thread shortly after it went up and have been desperately trying to resist this post but it won't go away. I look at the code of sites where I think "how did they do that?" only to find they are all XHTML.

Sooooo, given the quote above, why is everyone using the one with go-faster stripes? Because they can?
____________
smee...Vicki

Mods and gurus – THANK YOU!
For your time, knowledge and experience so willingly and generously given.
Please come back tomorrow and sort us all out again Smile

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 39 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

smee...Vicki wrote:"because

smee...Vicki wrote:
"because they can?"

In a word? yes! no one can criticise you one little jot for using an html4.01 DTD, Strict though rather than trans, trans DTD's must only be used for existing old pages, new pages must be written to strict syntax and rules.

In essence:
There are two and only two criticisms that can be levelled; the first is the most heinous and that is to use no DTD, the second and lesser of the two evils is to use a trans DTD when one shouldn't be.

Use XHTML 1.0 (never 1.1 when served as text/html) or use html 4.01 it is your choice , my contention though is that if your going to use XHTML then you should understand some of the arguments involved as to what XHTML actually is , and why you achieve next to nothing in using it!

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Smee
Smee's picture
Offline
Elder
Adelaide, Oz
Last seen: 5 years 15 weeks ago
Adelaide, Oz
Timezone: GMT+9.5
Joined: 2007-06-10
Posts: 1596
Points: 340

From reading the forum I

From reading the forum I realised I would need the strict DTD when I decided to go back to HTML. The Ian Hickson paper (in your How To... but I had followed a link prior to reading that) pointed out I had no good reason to use XHTML and would probably just set myself up for more problems since I don't have the experience or the need for it.

Quote:
If you use XHTML, you should deliver it with the application/xhtml+xml
MIME type. If you do not do so, you should use HTML4 instead of XHTML.
The alternative, using XHTML but delivering it as text/html, causes
numerous problems that are outlined below.

Unfortunately, IE6 does not support application/xhtml+xml (in fact, it
does not support XHTML at all).

Thanks again to the mods and helpers here - you do a great job.

Vicki

Mods and gurus – THANK YOU!
For your time, knowledge and experience so willingly and generously given.
Please come back tomorrow and sort us all out again Smile

Ed Seedhouse
Ed Seedhouse's picture
Offline
Guru
Victoria British Columbia
Last seen: 1 year 33 weeks ago
Victoria British Columbia
Timezone: GMT-8
Joined: 2005-12-14
Posts: 3570
Points: 675

I pretty much agree with

I pretty much agree with that reasoning these days and tend to go for 4.01 strict myself.

Ed Seedhouse

Posting Guidelines

Watch out! I am carrying irony, sarcasm and satire, and know how to use them.

Smee
Smee's picture
Offline
Elder
Adelaide, Oz
Last seen: 5 years 15 weeks ago
Adelaide, Oz
Timezone: GMT+9.5
Joined: 2007-06-10
Posts: 1596
Points: 340

Oops....

...double post :blushing:

Mods and gurus – THANK YOU!
For your time, knowledge and experience so willingly and generously given.
Please come back tomorrow and sort us all out again Smile

Smee
Smee's picture
Offline
Elder
Adelaide, Oz
Last seen: 5 years 15 weeks ago
Adelaide, Oz
Timezone: GMT+9.5
Joined: 2007-06-10
Posts: 1596
Points: 340

:o)

Then it's nice to know I'm in such good company Ed Smile

Mods and gurus – THANK YOU!
For your time, knowledge and experience so willingly and generously given.
Please come back tomorrow and sort us all out again Smile

SuperRoach
SuperRoach's picture
Offline
Enthusiast
Ballarat
Last seen: 11 years 4 weeks ago
Ballarat
Timezone: GMT+10
Joined: 2007-02-26
Posts: 291
Points: 6

didn't expect it to still

didn't expect it to still have responses in it Tongue

I've moved to 4.01 strict, and cleaned up general things that xhtml forces you to do (relaxed all lowercase, needing /> closures etc )

Sounds like xhtml is an added layer of work really, with no payoff unless your going to take advantage of it.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 39 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

It's worth just mentioning

It's worth just mentioning that there are certain disciplines that ought to be followed just as they represent good coding practise.

HTML 4.01 as written is case insensitive, but it is still good practise to keep all tag elements written in lower case, also in HTML/SGML it is permissible to omit certain tags such as 'body' as the actual element body is implicit regardless of whether you actually write the tag itself <body> this also holds true for certain element tags such as </p> and </li> you are not required to write them as closing a parent div or the ul element with their closing tags implies that the child elements must also have been closed. I would say that again it's better to be explicit and write all tags opening and closing.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me