How to validate Html pages with coding point of view for any website as coder/developer/tester ?

Why we need to validate Html design/pages before implementing them in websites with any language like java,.net ? As we all know , if defects found at earlier stage then project/product get many benefits interns of  Cost ,quick fixing,on time delivery... Read the full text.