<<< HOME

WRITING A BASIC PAGE IN HTML

HTML is how we tell the browser what to do. Browser are stupid, you must tell them everything, just about.
  • You must tell the browser when to start doing something.
  • You must tell the browser when to stop doing something.

To tell the browser to start and stop, we use tags. Tags are messages to the browser placed between two carets ("< >"). To start the browser reading a page of code as HTML we write a begin tage <html>; to stop the browser reading the page of code as HTML we write </html>.

The slash ( / ) is the difference; the slash ( / ) tells the browser to stop.
    So, first off:
  • Every Web page written in HTML starts with the tag <html> and ends with the tag </html>.
  • Every Web has two main parts between the HTML tages: the head and the body. The body is where all the content is (pretty much), and the head has all the info for the browser to keep track of the page.
  • The head of the HTML page starts with the tag<head> and ends with the tag </head>.
  • The body of the HTML page comes right after the head, and starts with the tag <body> and ends with the tag </body>.
So, your basic Web page, without any content at this point, looks like this on paper:

<html>

<head>
</head>

<body>
</body>

</html>

 

The tags above tell the browser to do these things in strict order:

  1. Start reading this page as HTML code.
  2. Look here in the head for general page information.
  3. Stop looking for general page information.
  4. Start looking here in the body for content files and reading text.
  5. Stop loading content files and reading text.
  6. Stop reading this page.

The first thing the browser looks for in the head is what the page is called, that is, the title. The tags that add the title are in the head, which means they go between the head tags, as below. The tags for adding a title are, not surprisingly, <title> and </title>.

With the title tags typed in, the page looks like this:

<html>

<head>
      <title>
      </title>
</head>

<body>
</body>

</html>

Now we deftly types in what we want to call the page between the title tags.

Let's call the page, "Bob's First Page." You just type it in as such:

<html>

<head>
      <title>Bob's First Page
      </title>
</head>

<body>
</body>

</html>

Now let's add content. Content is entered between the two body tags.

Type in some inspirational message, like, "Hi. My name is Bob and this is my first page in HTML."

<html>

<head>
      <title>Bob's First Page
      </title>
</head>

<body>

Hi. My name is Bob and this is my first page in HTML.


</body>

</html>


VIEWING YOUR PAGE IN THE BROWSER

  1. Save your page in your own folder.
  2. Name the file whatever, but it must end with .html (or .htm).
  3. Open the browser
  4. Go to FILE > OPEN
  5. When the dialogue box opens, browse to your file and open it.

It shoule look something like this:

bob's page