With HTML5 we can be a little lazy, perhaps sloppy too.
Lets start with the DOCTYPE, this is really easy:
The
Pretty painless right? You might be looking at this and thinking where are the quote marks to the attribute:
The best thing to do is pick a style and stick to it.
Also:
This will validate just fine, even though it has no <html> tag, no <head> tag and no <body> tag, this is because browsers assume them any way as you can see from the screen shot:
Lets start with the DOCTYPE, this is really easy:
<!doctype html>thats it.
The
<meta>tag is quick and easy too:
<meta charset=utf-8>thats it.
Pretty painless right? You might be looking at this and thinking where are the quote marks to the attribute:
charset="utf-8"
and its not self-closing:
<meta charset=utf-8 />? well thats just it, this isn't a XML language so you don't need any of those things, but this doesn't mean you can be sloppy, because you should always practice good mark up and keep it consistent.
The best thing to do is pick a style and stick to it.
Also:
<!doctype html> <meta charset="UTF-8"> <title>Chet Tailor's HTML5 blog</title> <p>Some really interesting stuff</p>
This will validate just fine, even though it has no <html> tag, no <head> tag and no <body> tag, this is because browsers assume them any way as you can see from the screen shot:

No comments:
Post a Comment