The easiest way (in my opinion) is to use the FireFox HTML Validation Add-On.
(However this points out error/warnings W3C doesn’t consider errors/warnings, and vice versa). For the best results, use “Serial” when the add-on is installed and asks what kind of validation you want.
I don’t know about dreamweaver validation, I don’t use it. (I use NetBeans, code HTML by hand, not WYSIWYG).
And yes, HTML 4.0 is currently the newest version of HTML, though most websites nowadays use XHTML 1.0
HTML 5.0 is in the making and most modern browsers already have some support for that.
It’s up to you to guess which browser doesn’t.
Hint: It’s developed in Redmond …
Personally, I use the W3C validator. But there do seem to be good alternatives, such as Firefox plugins etc.
I am very intimidated by HTML Validation. I get kind of lost trying to do it.
You can always post here for a translation of the results. Really, though, if you do a quick survey of the HTML rules, you won’t go too far wrong, and validation is pretty simple, I find.
By the way, how do I know I am using the latest HTML? Is that HTML4.0? Sorry for such an simple question…
HTML 4.01 has been the standard for around ten or more years now. Typical Doctypes look like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
HTML5 is still being invented and isn’t ready for use. XHTML 1.0 / XHTML 1.1 is a popular variant that has found itself in a kind of dead end street, but it has stricter validation rules and doesn’t work properly in IE anyway, so it’s not worth bothering with IMHO unless you have a specific reason for using it (like doing something with XML… whatever that might mean!)
All right, then I’ll just say I use XHTML 1.0 Transitional, serve it using the content-type text/html, and I’m happy with that setup.
No need to agree with me, everyone has their own preferences
That might be OK, as long as you don’t mind having the browsers that do support XHTML not render the pages in strict mode.
I serve XHTML pages as XHTML to browsers that support it, and XHTML pages as HTML to those that don’t.
I’m not 100% convinced it’s 100% reliable but it seems to be - i.e.
NOT user-agent sniffing but
if (stristr($_SERVER["HTTP_ACCEPT"], "application/xhtml+xml"))
As for validation, First, don’t worry if you don’t quite understand exactly what the error messages are saying, they become easy after you know what they mean. Well OK, that sounds dumb, but you’ll get them. And if you have trouble, as said, don’t be afraid to ask here.
Second. don’t feel overwhelmed by the number of them. Most often a single error will generate multiple error messages eg. a single unentitized ampersand creates 5! http://www.sitepoint.com/forums/showpost.php?p=4529357&postcount=3
So as you fix things and revalidate the number of them should go down relatively quickly.
Mostly, if you pay attention to why the validation errors occur, you can then make sure that your later work follows the same standard.
Before long you’ll be writing HTML code that passes validation with no trouble.
I also suggest the horse’s mouth [W3C] but I personally use the Fx plugin as a precursor. The DW Validation for the markup is similar to TIDY but the explanations it produces are sometimes nonsense.
Like was mentioned; a lot of the errors and warning are cascading and a caused by different unrelated things. So one trick is; you can sometimes use the comments <!-- –> to omit small sections of code while tracking errors so you can narrow-down the culprits.
Don’t get intimidated, instead use the w3.org Validator with the “Clean up Markup with HTML Tidy” checked, and you’ll get an automatically cleaned code outputted.
Copy the code the validator outputs at bottom of the validate message page, and you’ll have most of the counted errors fixed.
Then after testing that fixed code, validate it again and try fix the remaining errors manually. Mostly the errors are self explaining if you look closely. Warnings you can consider later.
If you get stuck, post both the error message and your line of code for help.
I used the Validation tool. It’s cool!
But my web page won’t center now! Can anyone tell me why? Is it because I should have a <div> around the entire website and then center it?
What is the CSS way of centering? I did not see “center” in the choices.
Where no width is specified, the default width of the block will be used instead. This is very useful for when designing liquid layouts.
In some situations the block will be at full width due to its content, so in those specific situations setting the width to be smaller than the full width allows the effect to take place.