PDA

View Full Version : Validation?




Butters
Feb 23, 2006, 04:28 AM
How important exactly is validation?
My Website (http://www.toe-knee.co.uk) fails the validator test Link (http://validator.w3.org/check?uri=http%3A%2F%2Ftoeknee.broken-sky.org%2Findex.php) quite badly.

Everything started out fine, during the development of the site I even put the valid xhtml button on my main page I was so proud :) but then it all went to poop near the end and I couldn't fix it so I just left it the way it was instead. I know I'm not the only person in the world to fail the test even apple.com doesn't pass that thing! so yeah I was wondering does it even matter?

(critique on my kinda new site also welcome)



munkle
Feb 23, 2006, 05:50 AM
Obviously ideally you'd like your page to validate but it certainly isn't the end of the world.

A more important consideration is how it renders.

xelterran
Feb 23, 2006, 08:27 AM
You have multiple doctype/head/body tags caught up in your loop. I'd start by removing them first you only need one.

Butters
Feb 23, 2006, 09:31 AM
Thanks, I fixed a few errors now mainly by removing the doctype etc. from the external .htmls.
The other errors I can't really see how I'm supposed to fix without starting from scratch again expecially as they're probably on all of the pages not just the index and well it's not really worth it I'm guessing?

whocares
Feb 23, 2006, 11:59 AM
Validation is important because it:
1. Shows you took care in laying out/creating your page.
2. Helps fix rendering bugs and make it as cross-browser compatible as possible (assuming said browsers are compatible with W3C standards).
3. Guarantees that the page will stay compatible in future browsers.
4. Tells Microsoft they need to make IE compatible with W3C standards.


Most importantly, if you're having rendering issues, trying to solve them with non standard code will be just a nightmare. Best practice is to use standards-compliant code, and use hacks to make it render properly on recalcitrant browsers (mostly IE).


[Edit:] You have at least 2 <html> & <head> tags. This will really mess things up. Get rid of those, and it might get rid of some of the other errors. Remember, basic layout in HTML is:

<!DOCTYPE etc.>

<html>

<head>
<title></title>
</head>

<body>

</body>
</html>

The above elements must be present in that order, and can only be present once.

Butters
Feb 23, 2006, 12:46 PM
You have at least 2 <html> & <head> tags. This will really mess things up.

The problem is the second <html> and <head> tags are in an external "header.php" file which i've included using php. I can't remove them because it messes up things like the rss feed and styles which then messes up other pages of the wordpress blog that also have the header in them and it's all kind of complicated.

Thanks for actually explaining why validation is important though I'm still kind of new to all this. I will definately make sure my next layout validates it sounds like in the long run it makes things easier.

whocares
Feb 23, 2006, 01:12 PM
Well a half-arsed solution to your problem would be to remove the head tags from your host PHP script - at least when Wordpress is involved. However this *far* from being an ideal solution.

Search the web, I'm quite sure there's an easy way to integrate WordPress into an existing site. ;)

Josh
Feb 23, 2006, 02:24 PM
The importance of validation depends on your target audience.

If you intend your page to be visited by people using screen readers and other devices to assist people with disabilities, then validation is important. Not so much stylistically, but the proper syntax of the doctype you use will insure that the aiding device works as intended.

However, if you plan to have your site visited by people with no vision problems or using any kind of aiding device, then validation means little more than bragging rights.

Theoretically, validation has a purpose to insure that your site looks the same (similar) in different browsers. Using proper code is the best way for this to happen.

However, browsers today do not read just one doctype, nor are they very strict about it. Today's browsers understand all the doctypes simultaineously, meaning you can use xhtml stict/transitional code side-by-side with html 4.0 and any modern browser will render it as you intend.

However, there are some people still using IE versions below 5, and no-name browsers that render code very poorly, so using the proper code per doctype will help make your page work correctly for these people.

If your page works like you want in FireFox, Safari, IE 5+, but does not validate, as long as it's not a site about or for blind people, don't sweat it. Just make sure to use all opertunities for alt and title tags.

You will find most professional sites don't validate. This is partly because validation isn't the end-all of good web design, and partly because most professional sites use content management systems and community publishing software. When you've got several people creating content for one page, you're bound to have a few who don't write valid code.

There seems to be a prententious movement of self-proclaimed designers who will scorn you and scream bloody murder because a 50+ page site doesn't validate, and they will link to their (un-unique) 4-page "portfolio" that validates. But honestly, in real-world situations, most validation can be over-looked.

So you didn't include a title for every <a href> on your site? No big deal.

I'm a CMA for michigan.gov, which is one of state government's most accesible sites, and has won numerous awards, so I am all for validation and accesibility.

But for personal sites and sites that don't need to cater to 100% of the public and all aiding devices, validation is near meaningless.

Butters
Feb 23, 2006, 02:52 PM
I've used the half arsed approach of removing duplicate doctypes etc. for now and I'm gonna start adding some titles and alts to images.
I think that'll do until I next completely redesign the site

Thanks for the post Josh, very helpful :)

whocares
Feb 23, 2006, 03:34 PM
I've used the half arsed approach of removing duplicate doctypes etc. for now and I'm gonna start adding some titles and alts to images.
I think that'll do until I next completely redesign the site

Thanks for the post Josh, very helpful :)

Yes, Josh's post was insightful.

title attributes - unlike alt attributes, are optional with the img element. So don't bother if you don't want to. They are however a way to get a nice "hover" caption for your images.

MrSugar
Feb 24, 2006, 12:58 PM
The importance of validation depends on your target audience.

If you intend your page to be visited by people using screen readers and other devices to assist people with disabilities, then validation is important. Not so much stylistically, but the proper syntax of the doctype you use will insure that the aiding device works as intended.

However, if you plan to have your site visited by people with no vision problems or using any kind of aiding device, then validation means little more than bragging rights.

Theoretically, validation has a purpose to insure that your site looks the same (similar) in different browsers. Using proper code is the best way for this to happen.

However, browsers today do not read just one doctype, nor are they very strict about it. Today's browsers understand all the doctypes simultaineously, meaning you can use xhtml stict/transitional code side-by-side with html 4.0 and any modern browser will render it as you intend.

However, there are some people still using IE versions below 5, and no-name browsers that render code very poorly, so using the proper code per doctype will help make your page work correctly for these people.

If your page works like you want in FireFox, Safari, IE 5+, but does not validate, as long as it's not a site about or for blind people, don't sweat it. Just make sure to use all opertunities for alt and title tags.

You will find most professional sites don't validate. This is partly because validation isn't the end-all of good web design, and partly because most professional sites use content management systems and community publishing software. When you've got several people creating content for one page, you're bound to have a few who don't write valid code.

There seems to be a prententious movement of self-proclaimed designers who will scorn you and scream bloody murder because a 50+ page site doesn't validate, and they will link to their (un-unique) 4-page "portfolio" that validates. But honestly, in real-world situations, most validation can be over-looked.

So you didn't include a title for every <a href> on your site? No big deal.

I'm a CMA for michigan.gov, which is one of state government's most accesible sites, and has won numerous awards, so I am all for validation and accesibility.

But for personal sites and sites that don't need to cater to 100% of the public and all aiding devices, validation is near meaningless.



Josh, I hear your opinion but I disagree on some of your points.

While many people do talk about page validation and then show you their small scale site all XHTML 1.1 strict it is somewhat mis-leading. However, that does't mean that validation and standards support can't be achieved for larger sites.

I reference ATT.com, which has moved to a completely standards based site. You will also notice that it validates XHTML strict1.0. The benefits of standards based design are very real, and to ignore them or say they only benefit users with screen readers or disabilties is ignorant.

Validation and standards is not simply a "bragging right" method. It actually has real world benefits. If you look at the bandwidth that is saved by implementing standards you can appreciate the benefits. Once again I can point to ESPN.com as a major site which has benefited from moving to a standards based design. Secondly, sites are much easier to upgrade, re-design, and manage when they are created with standards. The code is clean and easy to edit, but the main advantage it that it is styled all via CSS. This means you can re-design a site simply by changing a few CSS files and never having to touch the HTML. The benefits of this are clear. Re-design without re-coding is a huge leap over our previous table based sites. Also, with the implementation of standards and CSS you can design your content based on the medium. You can specifically create styles to make content look good when printed or viewed on a handheld device.

While I see your point about the "real word" idea of standards, I fealt it was important to make sure people realize validation and structured standards do have real life benefits and are not just some fad. They are changing the way the web works and sooner or later every site will be designed using some method of standards based design.