Tags can be written in lower or upper case: <tag> and <TAG> will operate in exactly the same way.
With that in mind, let's look at a simple example of HTML. You can view this page (press Back on your browser to return here when you're done).
<html> <head> <title>My Homepage</title> </head> <body> <h1>Hello, this is my page</h1> I'm a student at <b>Swansea University.</b><p> I'm also a member of <a href="http://www.sucs.swan.ac.uk/">SUCS</a> </body> </html>The tag <html> at the beginning of the document tells the browser that what follows is a HTML file. All HTML files are divided into two sections - a head and a body.
The head of the file always starts with the tag <head>, and finishes with the tag </head>. The head can contain general information about the file: its author, subject matter, copyright status and so on. In this case, all we've put in the head is the title of the page (between the beginning and closing tags <title> and </title>). The title of the page will normally be displayed at the top of the browser window, next to the browser name.
The body of the file now follows. The first line of the body shows an example of a heading. Heading size 1, denoted by the tags <h1>...</h1> is the largest size of heading available in the browser. Text marked with <h1> will normally be written in bold type, significantly larger than normal text. We'll discuss headings in more detail later.
A normal line of text then follows. If you've viewed the example file, you'll have noticed that the text 'Swansea University' appears in bold. This is accomplished by the tags <b>...</b> at the beginning and end of the phrase. Other text effects are also available - we'll return to these.
This line of text finishes with the tag <p>. This tag means 'end paragraph' - the browser prints a blank line between this and the next line of text. Note that the web browser will not move on to the next line of text unless it finds a specific tag telling it to do so - it ignores the position of new lines in your HTML file. The <p> tag, by its nature, doesn't need any form of closing tag.
The next line shows the main feature of HTML: the ability to create links
between one document and another. The code for this is
<a href="location of other page">...</a>
The location of the page to be linked is given in the quotes following href=. This should normally be of the format http://... that Netscape and other browsers show just below the menu bar. However, if you're linking a page in the same directory, you can just give the filename within the quotes (or a path to a subdirectory if the file is within the subdirectory). This brings us on to...
Next Section: Locating your files and
letting others see them
Back to Index