Professional Documents
Culture Documents
ITNP43 - HTML Practical 1 Write Your Own Web Page: Earning Utcomes
ITNP43 - HTML Practical 1 Write Your Own Web Page: Earning Utcomes
ITNP43 - HTML Practical 1 Write Your Own Web Page: Earning Utcomes
LEARNING OUTCOMES
By the end of this practical you should be able to create a simple web page by
writing HTML using a simple text editor, TextPad. You will be able to specify
and format:
Page titles
Headings
Paragraphs
Inline images
SUPPORTING DOCUMENTATION
There are lots of links to information about HTML on the ITNP43 resources
page (http://www.cs.stir.ac.uk/courses/ITNP43/resources.html), or you can
search for some yourself. A particularly useful link is w3schools XHTML
tutorial located at: http://www.w3schools.com/html5/
Validation of your HTML can be done at: http://validator.w3.org/
Courtesy of VisiBone (http://www.visibone.com/), a quick popup of all
HTML tags and a useful hexadecimal-to-colour converter can be found at:
http://www.cs.stir.ac.uk/~bpg/WWWstuff/VisiBopop/deskpop.htm
There are many many web sites which offer free "clip art", where you can
obtain images that you can use in your web pages. For example see:
http://classroomclipart.com
GETTING STARTED
Although it is possible to created web pages using a WYSIWYG tool such as
Adobe Dreamweaver or even Microsoft Word, such tools do not provide the
level of control of detail that may be necessary. Sometimes you really just
need to get your hands dirty and get into the HTML code in order to produce
the document you really want. You will learn to write your own HTML
documents. You should finish this worksheet with an appreciation of how
the HTML code relates to the finished output displayed in a web browser.
Go to Groups\ITNP43 (V drive, inside Computer) and run the setweb
program (double click it).
This has the effect of creating a folder called Web in your Documents
folder, with particular access permissions.
This folder is important! Do not delete it. This is where you must store your
HTML files and associated files if they are to be accessible via the web (by
specifying a URL in a web browser).
To start you off we’ve provided a template web page.
Copy the folder WWW1 file from the Groups\ITNP43\ folder into your
Web folder in your home folder. It contains template.html (and
some other files).
This worksheet will take you through some modifications to the file
template.html, using the text editor TextPad to make the modifications.
(You may use Notepad if you prefer, but TextPad uses colouring to help
identify the structure of an HTML document).
Start up TextPad. (You’ll find it in Start->All Programs – “Start” is the big
button in the bottom left hand corner. TextPad might be under
Applications, if you do not see it straight away)
Using TextPad is quite straightforward. It is a bit like a word processor, but
not as sophisticated; it’s much simpler than Word. You will just be typing in
text and saving it. You will not do any text formatting in TextPad itself. All
HTML documents are simply text files.
Open up the file template.html in TextPad.
Now you can see the HTML source for the web page. How do you view this
in the browser?
Start up a web browser e.g. Internet Explorer.
Type the URL for your “template” page into the address/location box
and press Return. (For example, for user Susan J Bloggs, whose
username is sjb001, the URL will be
http://www.students.stir.ac.uk/~sjb001/WWW1/template.html).
The ~sjb001 is the way that your Web folder is identified in a URL. You may
store your HTML files in folders within your Web folder if you wish (it's a
good idea to keep them well-organised!). Notice that you can specify files
within folders, and also that the browser translates this URL into something
slightly different.
Now let’s customize this page. We’ll start by making some very simple
changes to the page, but once you’ve done these you can make the page as
complicated as you like!
A tip: Set Configure: Word Wrap in TextPad so the text doesn’t head off to the right
of your window.
Page Heading
Usually it’s a good idea to make the top level heading the same as the title.
Add the heading <h1> An HTML Exercise</h1>
You might find <h1> headings rather big. Try <h2> and <h3> headings as
alternatives.
Save your work at all stages, and keep checking what it looks
like in the browser.
Don’t forget that paragraphs start with <p> and finish with </p>. You could
add extra headings, too, to separate different subjects.
Text Styles
Tags can be used to specify how bits of text are displayed e.g. whether they
should be emphasised in a special way or not.
Try enclosing a few words with <em>…</em> or <strong>…</strong>
You can try nesting different effects, too, to see how they combine. If you
have forgotten what tags are available, then have a look at your lecture notes
or try the w3schools tutorial.
HTML is not really designed for specifying styles, or other presentation
features such as fonts and colour. Later in the module we will see how to add
these things to our web page via the use of style sheets.
Link it up!
Links are created using anchor tags, <a …> … </a>. We can also use anchors
to link to other web pages. Create a link from where you typed “ITNP43” to
the ITNP43 home page by surrounding “ITNP43” with an anchor:
Replace the “ITNP43” that you have already typed in your text by:
<a href="http://www.cs.stir.ac.uk/courses/ITNP43/">ITNP43</a>
Save your page, refresh it in the browser (F5), and click this link.
Your browser will change to the home page for ITNP43. To get back to your
page, click the browser’s Back button.
Pretty Pictures
One way to make your page look better is to add graphics. There are some
GIFs in the Groups\ITNP43\Pix folder and on the “pictures” link on the
ITNP43 practicals web page, but feel free to download your own from other
sites (as long as they are not copyright protected.)
Inline images can be included anywhere in your document using the <img>
tag.
Try including <img src=”filename.gif” alt=”description”> (where filename
is one of the files in your Web folder) or <img src=”Pix/filename.gif”
alt=”description”> (if you have stored your image files in a subfolder
called Pix) somewhere suitable in your document.
Don’t forget to use the alt attribute to add a suitable short description
of your image.
Try different images. Some of the ones provided are “animated” GIFs that
provide a simple moving image.
That’s it for now. But you will learn by experimenting, so try out other
things.
Just one footnote: whenever you are creating your own HTML files, DO NOT
use spaces in your filenames. Spaces can cause problems when typing in the
URL on browsers.