home Designing Webpages
Ka-Neng Au
HOME
INTRODUCTION
LAYOUT
FORMAT
LINKS
LISTS
TABLES
BACKGROUNDS
IMAGES
NAVIGATION

LAYOUT (BLOCK FORMATTING)

You begin with defining your Webpage as an HTML document. A Webpage has two principal sections, a head and a body. In the head, you may add a title which will appear in the top blue bar of your browser. Note that all tags are used in pairs, with an opening tag and a closing tag.

You may also include meta tags such as keywords, a description, and the author of the Webpage, but none of these will be displayed. Meta tags are used by many search engines to index Webpages. The content of your Webpage which is to be displayed will be in the body.

<head> <title>My Webpage</title> <meta name="keywords" content="Webpages, web pages, tutorial" /> <meta name="description" content="Some tips on Webpage design" /> <meta name="author" content="Ka-Neng Au" /> </head> <body> . . [this is where the text of your Webpage will go] . </body> </html>

Here are some basic HTML tags which will affect the layout of blocks of text on a page. The two exceptions to tags being used in pairs are at the end of the list:

<h2> = begin a heading (h1 is largest, h6 is smallest) </h2> = end a heading <p> = begin a paragraph </p> = end a paragraph <center> = begin centering the text that follows </center> = end centering <br /> = break, to end a line <hr /> = horizontal rule

Exercise:

<head> <title>My Webpage</title> </head> <body> <center> <h2>My Webpage</h2> </center> <h3>First Paragraph</h3> <p> This is the first sentence in the first paragraph. <br /> This is the second sentence, which should appear on its own line. </p> <hr /> <h3>Second Paragraph</h3> <p> Here is the second paragraph. <center>This will be centered on a separate line. </center> </p> <hr width="300" /> </body> </html>
This page was last updated 24 March 2004.