How to make an Hello World Web PageA web page has two main parts to it: the header, which you don't normally see and the body which contains the content. |
The HeaderThis tells the computer what the document is and how to read it. You can put your JavaScript in here and also calls to other things like CSS styling sheets to make your page look pretty.
In order to get our examples to work you will need a basic header such as this. This tells the computer that what follows is written in HTML and uses the standard characters etc.
<!DOCTYPE HTML>
So open your text editor, copy the stuff above in and save it as something like "MyHelloWorld1.html" etc. |
The BodyNow you need to give the web page some content. Add this code to the header and then save it.
<body >
|
Running The CodeYou can just double click on your file in its folder. Or drag and drop the file into an open window of your browser. |
last updated 3rd September 2014