01

tutorial | 01

Basic HTML

  • What is HTML?


HTML is one of the programming languages used to "write" websites. Every website is made up of a set of different codes that tell the browser how to display the information. HTML uses tags to define how information is displayed.

  • Opening Notepad


The first thing we need when coding HTML is a simple text editor like notepad. Open this by pointing to Start > Programs > Accessories > Notepad (for Windows users).

  • Creating your first code


Once you have opened Notepad you can start typing HTML tags directly into the text part of Notepad. Every website start with the <html> tag and all (or rather most) tags need an end tag which looks like this </html>. The end tag has a backslash in front of the value.

The second tag that you will come across is the <head> tag. The <head> tag tells the browser what to put in the header part of the window. Inside the head tag you'll find the <title> tag. The <title> tag is the actual text to display in the header. After the <title> tag you get the end title </title> tag and then the end head </head> tag. Now before you can end your <html> tag, you need a <body> tag. The <body> tag contain all the elements that will be displayed on your website, e.g.. pictures, text.

Lets put all of these tags together.


<html>
<html>
<title>
This is the text your browser displays </title>
</head>

<body>

</body>
</html>


In order for your page to display something you need some code in the <body> part of your document. Let's start with some simple text. To add simple text to your site, simply use the paragraph <p> and </p> tags. These tell your browser that it's a new paragraph. We also want to make this text bold <b> </b> and underlined <u> </u>. Make sure you close the tags in the order that they are opened.

Add the following code to the <body> section of your document.


<body>

<p> <b> <u>  This is simple text to indicate a new paragraph that is underlined and bold.. </u> </b> </p>

</body>



  • Saving and viewing your page.


Now that you have a very basic page you can save it and view it in your browser. To save your page as a HTML file you'll have to go to File > Save as...

Type "index.html" in the File Name field, and choose *All Files from the Save as type field. Create a new folder named "HTML Tutorial" under "My Documents" and save your file in that folder.

Go to to My Documents > HTML Tutorial and double click the file named index.html. It should automatically open in your default browser.

Congratulations!!! you have just created your first web page!