Page 43 - DCAP408_WEB_PROGRAMMING
P. 43
Unit 2: Creating Static Web Pages
The “body” comes after the head structure. Between the body tags, you find all of the stuff that Notes
gets displayed in the browser window. All of the text, the graphics, and links, and so on - these
things occur between the body tags.
The strict variant of HTML 4.01 requires that any content inside the body is within a further set of
tags (if you use the transitional variant of HTML 4.01, this is not necessary). For text, you can use
“p” (the paragraph tag). A complete page would then look like this as shown in below example:
Example: Writing a paragraph in HTML.
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN”
“http://www.w3.org/TR/html4/ukt.dtd”>
<html>
<head>
<title>This is my very first HTML document</title>
<meta http-equiv=”content-type” content=”text/html;
charset=ISO-8859-1">
</head>
<body>
<p><h1> Here is where the actual content of the page goes.
Note that it does not matter where I start a new line...
or wether I leave space between two lines. </p></h1>
</body>
</html>
This will result in the following page being displayed in your browser as shown in Figure 2.1.
Figure 2.1
If you want to leave yourself notes in an HTML document, but don’t want those notes to show up
in the browser window, you need to use the comment tag. To do that, you would do the
following:
<!— This is a comment. —>
Steps to run Example
1. Save the above example as HTMLExample.html.
2. Open the browser.
LOVELY PROFESSIONAL UNIVERSITY 37