Sunday 8 May 2011

HTML5 - Hello World

As part of the first lesson of HTML & CSS From the Beginning I’ve asked the students to create Hello World and keep doing it until they can do it from memory. I’m not a huge fan of learning by rote, because it doesn’t really get you to understand what it is you’re doing. But they are times that it comes in handy this is one of those times. In order to craft websites by hand, you’re going to have to start off with a solid document structure.

If you’re one the students looking at this then remember to pay attention to the indentation. Correct indentation makes your source code much easier to read and it makes the structure of document visible. You can either choose to indent with tabs ( my preferred way ) or you can indent with spaces. Either is fine, though you may run into some ‘discussion’ about which method is best.

My version of “Hello World”

<!DOCTYPE html> <html lang="en">     <head>         <meta charset="utf-8">         <title>Hello World</title>     </head>     <body>         <h1>Hello World</h1>         <p>             Jamie was here.         </p>     </body> </html> 

Over the coming weeks of the course we’ll break this down so that the students can understand what it is they’ve committed to memory.