HTML – intro

**Note: To write a comment in HTML use <!– write comment here –>

HTML – Html code is used to create a web page. It tells the browser how to interpret and display the web page.

A) Plain HTML File:

Create a new file in notepad++

Type the code shown below: – add the indents for good programming style

<html> 

<body>

Hello World

</body>

</html>

Save the file as hello.html
(Remember to chose ALL FILES from the File Type drop down list)

Double click on the file hello.html

A Web page with your message should open – notice all it says is Hello World with no formatting. Notice we didn’t tell the browser to do anything but display the text Hello World. If we want to control the way the text appears on the page, then we have to add more tags to it.

B) A fancier HTM page:

Re-open your hello.html page in NOTEPAD++

Change the Code so it looks like the following:

<html>

<body style=”background-color:black;font-size:18;color:blue”>

<p style=”color:red;font-size:24px;text-align:center”>

Hello World

</p>

This is my web page

</body>

</html>

Save the changes to the file.

Use a web browser to preview the file again. 

 

____________________________________________________________________________________________________

 ASSIGNMENT

After working through the above examples…

Use Notepad++ or some such program and create an HTML script that:

  • has your name as a comment
  • uses the formatting code from section B above
  • has text of your own choice

Save your script file as home.html and run it to test it.  Then hand in your code as a .txt file.

____________________________________________________________________________________________________