You can validate your website using this validation service. If you are using Opera, validating a website is just one click away : Right Click -> Validate.
Recently I have updated all my free wordpress themes to be 100% xhtml valid. After validating each of them, I found that there were some common errors, which can be solved by:
This is also known for improving your site’s SEO. Whenever you use <img> tags you have to add an alternate text. If you do not have alernate text to add, at least leave it empty like this alt=""
Invalid
<img src="" /> |
Valid
<img src="" alt="" /> |
Tags like <img> , <br> , <meta> need to be self-closed.
Some other self-closing tags are:
One example, the meta verification tag given by Yahoo! Site Explorer (Yahoo webmaster tool) is always in uppercase and not self-closed, which make my page invalid.
You have to manually change the word “meta” to lowercase and self-close the meta tag.
Given by Yahoo! – invalid
<META name="y_key" content="xxxx" > |
Edited to make it valid
<meta name="y_key" content="xxxx" /> |
If you have javascript codes in your page, you have to make it valid as follow:
Invalid
I will output "Hello world!" using javascript.<br />
<script type="text/javascript">
document.write('Hello world!');
</script> |
Valid
I will output "Hello world!" using javascript.<br />
<script type="text/javascript">
//<![CDATA[
document.write('Hello world!');
//]]>
</script> |
By adding cdata tag, you can make your inline javascript codes to be valid. If your javascript loaded from external js file, it will not make your page invalid so you do not have to worry about that.
By default, the embed codes given by youtube are not xhtml valid.
To make it valid, you can refer to the guide I wrote on last month.

Excellent guide. Thanks alot.
Good information, i will wait for your next XHTML Tutorial.
Thank you.
Thank you for writing this, it was quite handy and showed me quite a bit
Too many compmelints too little space, thanks!
Ola! Zenverse,
Speaking of which, XHTML is the big in-thing in web designing these days. It is the fastest growing trend that has now become a highly sought after service. So what is XHTML, and how does it guarantees browser compatibility? Let us study it in some detail.
Cheerio