HTML is such fun to learn. All you need for this tutorial is a text editor such as Notepad or Notepad++ and a browser and you will see results instantly!

It is critical that you can view file extensions in the File Explorer when you are creating the files for your website! You must be 100% certain that your file is not called index.html.txt!

File Extension

An HTML file is a text file with the extension .html:

  1. Save a blank text file as index.html.
  2. Your computer probably opens HTML files with a browser by default, so if you double left-click on the file you just saved it will open in your default browser. It will display a blank webpage.

Text

  1. Open index.html in your text editor.
  2. Type Hello World! in the first line of your HTML file, press Enter and type My first web page. on the second line.
  3. Save the file, switch back to your browser, and press f5 on the keyboard to refresh the page.
  4. Note that although the text in your source file (the text file) is typed on two separate lines, the text appears continuously as one paragraph when displayed in the browser.
Hello World!
My first web page.

Tag

HTML tags describe the text on the web page:

  1. Switch back to your text editor. At the beginning of the first line, before the text, type <h1>.
  2. Press End on the keyboard and type </h1>.
  3. Save the text file, switch back to your browser and refresh your page.
  4. Note that the first line is now a heading (font size is larger and bold) and the remaining text is “normal” and in a new paragraph of its own
<h1>Hello World!</h1>
My first web page.

Correct

Read more about “nesting” in the Nesting tags correctly in HTML tutorial.

Just because it works, it does not mean it is correct.

  1. Switch back to your text editor.
  2. “Nest” the second line of text between <p> (paragraph) tags.
  3. Save your source file and view the final code in your browser.
<h1>Hello World!</h1>
<p>My first web page.</p>

All the extra stuff

Your basic HTML website page requires several additional tags to be syntactically correct:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Hello World!</title>
  </head>
  <body>
    <h1>Hello World!</h1>
    <p>My first web page.</p>
  </body>
</html>

More about these tags (and more of them) in the An HTML5 boilerplate tutorial.

Next steps

Learn more about the basics:

Then move on to the following skills:

By MisterFoxOnline

Mister Fox AKA @MisterFoxOnline is an ICT, IT and CAT Teacher who has just finished training as a Young Engineers instructor. He has a passion for technology and loves to find solutions to problems using the skills he has learned in the course of his IT career.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.