Creating Web Documents

Hello, World

Concepts

How a Web document works

A public Web document is part of the World Wide Web and operates according the client-server model.

  1. A Web page is a file that resides on a server.
  2. People use client software (a Web browser) to access a Web page.
  3. Web sites can contain massive numbers of pages of hypertext and multimedia.
  4. A Web site truly represents a new kind of communication with unique characteristics and qualities.

How a Web Document is Composed

You create a file and put special character sequences called HTML elements into your file. These elements identify the structural parts of your document. When a Web browser displays the file, it will display your file's content, but not the characters that make up the structure.

A very simple HTML document

Here is an example:

Make a file called "hi.html" containing this Use your a Web browser to open the file "hi.html," and it will look something like this
<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
   <HEAD>
      <TITLE>
         A Small Hello
      </TITLE>
   </HEAD>
<BODY>
   <H1>Hi</H1>
   <P>This is very minimal "hello world" HTML document.</P>
</BODY>
</HTML>

Hi

This is a very minimal "hello world" HTML document.

Only the elements that you place in the BODY element (that is, between <BODY> and </BODY> ) ever get displayed in a Web browser's window.

In this example, only the contents of the H1 element (between <H1> and </H1> ) and the P element (between <P> and </P> ) are displayed.

The phrase you put between <TITLE> and </TITLE> will be displayed in the browser's title bar (for browsers such as Netscape Navigator or Internet Explorer; other browsers might display the title differently).

A "Hello, World" HTML document

Here is another fairly simple "Hello World" document.

You can click on the link and then use the "View / Source" option on your browser to look at how it is made.

The idea is that you put in the HTML elements into an HTML file (such as "hello.html"), and then you can view that file in a Web browser to see your contents displayed. You won't see the HTML structure elements themselves (HTML, HEAD, TITLE, BODY, H1, or P).

Parts of an HTML document

You can see some commonly-used elements of HTML demonstrated in the "Hello World" document:

The "Hello World" document also demonstrates the copyright entity (©).

An anchor for email in an HTML document

One frequently-used kind of anchor element (A) is a link to an email address. You can make one in your HTML file by adding this line (where userid@domain.com is your email address).

Put this in the BODY of your HTML file: Displayed in a Web browser, it will look something like this:
<A Href="mailto:userid@domain.com">send me some email</A>

send me some email

More kinds of anchors in HTML document

Take a look at this example to see how links are made to different kinds of Internet resources using different kinds of URL's in the href attribute of the A element.

Exercise: Prepare a Web document

Copy the "Hello World" document to your computer, call it "hello.html," and edit it to suit your interests, name, email address, etc.

Continue to develop your document and include different kinds of hypertext links as, for example, demonstrated in this example.

The Russian translation of this article is provided by Ilyuha.
search Search · star Market
2023-06-19 · John December · Terms © johndecember.com