HTML5, CSS3, and JavaScript Fourth Edition

(Ben Green) #1

CHAPTER 3. HEAD SETS THE STAGE 26


They provide two incredibly useful validators that can be used to find errors
in our HTML code or CSS code.


HTML Validator


http://validator.w3.org/is their validator for HTML code.


We can put this somewhere in our webpage to link to an HTML validator.


html5


CSS Validator


We can put this somewhere in our webpage to link to a CSS validator.


css3


JavaScript Validator


JavaScript can be very complicated. It is a full-fledged programming lan-
guage, and because it is the main language on webpages, it is probably the
most widely used programming language in the world.


Writing complicated pieces of JavaScript is far beyond the scope of this
book. But it is good to know that there are validators out there that can
look at our code and give us advice.


http://www.jslint.com/is provided by Douglas Crockford, one of the
original developers of JavaScript.


http://jshint.com/is a competing validator provided by Anton Kovalyov,
a computer programmer from San Francisco.


3.4 Document Type


Getting back to the actual writing of our webpages, the page starts by telling
what kind of document it is.


Required: DOCTYPE.The first piece of a webpage is the doctype line.
In HTML5 it looks like this:


<!DOCTYPE html>

Free download pdf