The following is a basic HTML page (see Figure 21-1):
<html>
<head>
<title> This is a basic Web Page! </title>
</head>
<body>
<p>Hello World! </p>
</body>
</html>
| Caution |
The <body> tag supports a background attribute that can be used to supply a watermark-type display to the whole page. When you use this attribute, make sure that your text contrasts with the background appropriately. |
The following shows how to use the prebuilt heading tags (see Figure 21-2):
<html>
<head>
<title> This is a basic Web Page! </title>
</head>
<body>
<h1>Hello World! h1</h1>
<h2>Hello World! h2 </h2>
<h3>Hello World! h3 </h3>
<h4>Hello World! h4 </h4>
<h5>Hello World! h5 </h5>
<h6>Hello World! h6 </h6>
</body>
</html>
Another basic element of an HTML page is an image. The following demonstrates adding a aimple image (see Figure 21-3):
<html>
<head>
<title> This is a basic Web Page! </title>
</head>
<body>
<img src="dotnet.gif" align="top">
</body>
</html>
This example uses the align attribute to place the image at the top of the page. Other align values include left, right, middle, center, and bottom . Two useful attributes you can use with images are width and height . You can also use the border attribute to give the image a border.
| Caution |
Be very cautious in using the width and height attributes, because you can distort the image when you change its size. |
HTML pages also typically have hyperlinks. The following demonstrates creating a simple hyperlink (see Figure 21-4):
<html>
<head>
<title> This is a basic Web Page! </title>
</head>
<body>
<a href="http://www.drudgereport.com"> Drudge Report </a> <br>
<a href="mailto:gmacbeath@comproium.net" > E-mail me </a>
</body>
</html>