next up previous contents
Next: Headings and Typefaces Up: The World Wide Previous: An Introduction to

Getting Started

A simple example of HTML is:

    <HTML>
    <HEAD>
    <TITLE>This is the Title</TITLE>
    </HEAD>
    <BODY>
    <H1>This is the Page Heading</H1>
    This is the first paragraph.
    <P>
    This is another paragraph,
    with a sentence
    that is split over several lines in HTML. 
    </BODY>
    </HTML>
When this is displayed by Mosaic, it will look like:

As you can probably guess, commands are enclosed in angle-brackets <>, so that the HTML command <TITLE> means that the following text is part of the title.

Commands beginning </ are the end of the equivalent command. For example to say that the text ``This is the Page Heading'' should be a level one heading (the largest type of heading), the complete sequence is:

    <H1>This is the Page Heading</H1>
A break between paragraphs is denoted <P>. There is no need for a </P> afterwards because the end of a paragraph is obvious from the start the next paragraph, list, heading or whatever.

Strictly speaking a page should start <HTML> and should end </HTML>, but the HTML specification also says that clients should perform correctly without them, and so many people omit them. Similarly the header of a document (the bit containing the title) should begin with <HEAD> and end with </HEAD> and the body of a document should begin with <BODY> and end with </BODY>, but in practice this isn't essential. The HEAD and BODY commands are newer additions to HTML, which allow some of the fancier features to be used, but if you're not using these features, you can safely omit both.

Documents written in HTML are not WYSIWYG - Mosaic and other WWW clients will re-arrange the layout of your text so it fits properly on whatever size display you try and display it on. So if you really want to break a line at a specific place, you should use <P>, rather than a carriage return, as Mosaic will remove the carriage return and replace it with a space, and then break your line of text at a point that is convenient for the current page width. Hence the text:

    <P>
    This is another paragraph,
    with a sentence
    that is split over several lines.
Will get formatted as:
This is another paragraph, with a sentence that is split over several lines.


next up previous contents
Next: Headings and Typefaces Up: The World Wide Previous: An Introduction to



Jon Crowcroft
Wed May 10 11:46:29 BST 1995