PDA

View Full Version : Can someone help me get my head round html validation


ewo
14th March 2006, 20:38
Strict? Transitional? Doctype?

Why? How? What?

Tazuk
14th March 2006, 21:08
I am no expert but having gone through validation and changing to xhtml i used the W3C validation and information on that website.

http://validator.w3.org/

You will find an explanation on doctype etc in the about section.

Tony

Coding Monkey
15th March 2006, 06:50
Transitional is basically just a slightly more strict version of HTML 4, and a lot easier to make compatible, not only for browsers, but also for validation, especially if you're using a CMS. It's the easiest way to begin moving forward to Strict, and you'll probably find you're doing a lot of it anyway.

Stephen
15th March 2006, 13:31
This is quite a useful intro to the subject...
http://www.alistapart.com/stories/doctype

(It's quite an old article, but broadly helpful I think.)

JustOneUK
15th March 2006, 16:50
Strict? Transitional? Doctype?

Why? How? What?
If you want your site to display properly on every single browser ever made, and wrist watches, then validating is for you...For all other normal sites there's mastercard :D

However there is no guarantee that if you validate a page/site that it will do anything at all for you. Google I believe don't use doc type statements, and neither google or yahoo validates....so who cares?

I made rotflmao (http://www.rotflmao.co.uk/) (*warning* contains nuts) just to prove a point, it validates and is made in css, does it make the slightest piece of difference? um...No.

ewo
15th March 2006, 16:56
I'm very grateful for all these responses, and have been faithfully following the links and studying the content. But I'm still none the wiser.

If I run my site through the W3C validator, I'm told, whatever doctype I put up, that it's not a valid doctype. So, I've left it without, but I've no idea what that means

Oh, how I wish I was valid:(

crus
15th March 2006, 17:01
On a personal level,

I am moving everything towards XHTML 1.1 (Strict), my mentality is that you can do anything that you can do elsewhere and the code should be at basement level of new coding standards based on xhtml.

It takes time, but I have finally found a use for dreamweaver!

D

ewo
15th March 2006, 17:05
I am moving everything towards XHTML 1.1 (Strict)And what does that mean/how does one do that?

Stephen
15th March 2006, 17:24
How about you put up a page with the DOCTYPE that you think best, perhaps...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

If you post the link, I'll take a look at the response from the validator and try to clarify it for you!

ewo
15th March 2006, 17:56
Tried that, and validator returned: This page is not Valid HTML 4.01 Transitional!

Stephen
15th March 2006, 18:07
That's not because you have the wrong DOCTYPE as such, rather that the code doesn't meet the requirements of the DOCTYPE you do have.

In the example you sent me, you only have 13 issues, most of which should be fairly easy to correct.

For example, issue number 5 for your home page is that (on line 82) you don't have an alt tag for an image - provide one, and you'll be down to 12 issues. If you work through the list one by one, you'll eventually get a page that will validate.

Perhaps get the number down as far as is possible - most of the errors are fairly well explained by the validator - then post any that you can't sort out here.

If you post the line in question, plus the message from the validator, we should be able to help!

Obviously this only fixes one page at a time, but once you get the hang of creating pages that validate, it shouldn't be too painful.

Hope this helps.

ewo
15th March 2006, 18:24
Thanks, so far Stephen.

BUT

This is so frustrating, as many of the errors which the validator picks up, don't actually exist in the source code.

And, why on earth, would anyone put an alt tag on a bit of shadow of an image?

Stephen
15th March 2006, 18:28
The errors do exist, but I agree it can seem pedantic.

If you can't see why it's complaining, post the error and the complete line it refers to.

As for alt tags on images like shadows, use alt="".

ewo
15th March 2006, 18:39
Stephen, alt="" was there before, so I've changed it back. Similarly, the local file that I'm uploading does not have the same errors..honestly.

I don't mind pedantry, I want to be valid, but this is soooo frustrating.

Will PM the code

Stephen
15th March 2006, 18:51
I think the reason the local file "doesn't have the errors" is because it's ASP that generates HTML - the resultant file has the errors. Not sure I understand exactly what you mean though.

To tackle a couple of the errors...
1. amend your script tag to include type="text/javascript", such as...
<script language="javascript" type="text/css">

2. background isn't supported - remove, and perhaps replace with a css based background image

3. assign your table row height by css, or on the td tags, removing them from the tr tags

4. remove the valign tag - perhaps use a class tag and set vertical position in css

5. add the alt tag to whichever line in your asp generates line 82 of your output html

6/7/8/9/10/11. remove the // from the comments - you don't need them here anyway

12. you have a closing quote delimiter (") missing from after your blank.gif src attribute

13. remove the name attribute

try that - see where we get to!

ewo
15th March 2006, 18:53
Thanks... will do