HTML BASICS |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This page is designed to help you understand basic HTML, and creating
your basic web page. If you have any questions, post them here using
"HTML help" as the subject, thankyou
such as Netscape 1.1 or later then this page will probably be very difficult to read.
The browser thus displays the document with regard to features that the viewer selects either explicitly or implicitly. Factors affecting the layout and presentation include:
The browser, ignores extra spaces and new lines between words and markup tags when reading the document. Thus, the following three text fragments will be formatted identically.
to produce the following:
The markup language is made up of tags such as which requests text that follows to be in bold type. This bolding is turned off by the inverse markup tag . In writing a tag, the case of the letters in the tag name is unimportant so that and represent the same tag. The basic layout of an HTML document and the resultant information displayed by a browser such as Netscape is shown below:
The tags used are:
The formatting tag with the attribute COLOR="red" is used to change selectively the colour of the text of the document to red. This temporary colour change terminates on the tag.
Possible values for a named colour are: black [###], maroon [###], green [###], olive [###], navy [###], purple [###], teal [###], gray [###], silver [###], red [###], lime [###], yellow [###], blue [###], fuchsia [###], aqua [###], white [###].
A general colour is specified in terms of the three primary colours red, blue and green. Each primary colour is defined as a two digit Hexadecimal number that representing the strength of that primary colour. In this specification hexadecimal 00 means 0% of the colour and hexadecimal FF means 100% of the colour. For example, to specify red the hexadecimal number FF0000 is used. In this number:
Additional attributes to the tag
For example, to create a web page with a background colour of green normal text in red and links in blue is specified with the following attributes to the tag
The document may also be given a background image. The selected image is tiled across the document and then the text of the document is written over the image(s). It is thus important to choose a background image that will not be too distracting for the reader. The background image is achieved by adding a background attribute to the BODY markup tag. For example:
Remember, the ability to display the colour depends on the colour depth of the monitor used by the viewer. Many people will only be able to display 256 distinct colours, and some will only have a black and white display. For viewers with a monitor with a limited colour depth other colours will be displayed by dithering. A process which simulates the un-displayable colour, by creating a pattern of dots in colours which when viewed at a distance will fool the eye into seeing them as a single new colour. Unfortunately this reduces the resolution of the displayed area.
The following are some of the logical formatting tags in HTML. These should be used to describe a logical unit of your document. The formatting of this logical unit may in some cases be the same as produced by other formatting tags. Remember, the tags specify logical units of the document, software other than the web browser may need this information.
A new paragraph is started with the tag, and may be optionally terminated with the inverse paragraph tag . However, it is usual not to specify the inverse paragraph tagA line break is created by the
A heading in the text is created with the tag. There are in fact
six heading tags the smallest. | is not
defined in the
HTML
specification.
As unrecognized
tags are ignored
by a browser
putting the tag
in does no harm.
Formatted text | HTML markup
required |
---|---|
An H1 heading |
|
An H3 heading |
|
An H6 heading |
|
A heading tag generates line break(s) before and after the heading text. For example:
Formatted text | HTML markup
required |
---|---|
Just before the
heading.
An H4 headingJust after the heading. |
Just before the heading. |
Formatted text | HTML markup
required |
---|---|
End of a
section
New section |
End of a section |
Only 40% of
width
New section |
Only 40% of width |
The size of the
ruler
New section |
The size of the ruler |
Note: The size of the ruler is by default specified in pixels.
Insertion of in-line images |
As well as text, images may be inserted into the document. An image may be held in several formats, though the main ones used are GIF and JPEG. Due to limited bandwidth, JPEG with its high compression of picture data and its ability to represent 24 bit colour images is the best to use. Even though the JPEG compression is lossy the degradation of picture quality is not very noticeable to the human eye.
However, if the picture is very small or a graphical image then the GIF format may be the best.
Inserted image | HTML markup
required |
---|---|
|
|
A gif image
|
A gif image |
|
|
|
|
This can also be used to distort the picture. |
|
An image may be used as the
displayed item for a hypertext
link. For example:
.
The attributes of the
tag include:
Insertion of a background image |
The document may be given a background image. The selected image is tiled across the document and then the text of the document is written over the image(s). It is thus important to choose a background image that will not be too distracting for the reader. The background image is achieved by adding a background attribute to the BODY markup tag. For example:
|
Creating a list of items |
There are several types of list, an un-ordered list can be created by the following markup:
Formatted text | HTML
markup required |
---|---|
|
|
An ordered list is similar to an un-ordered list, except that each entry is consecutively numbered.
Formatted text | HTML
markup required |
---|---|
|
|
A definition list allows a list with a backward hanging indent to be created.
Formatted text | HTML
markup required |
---|---|
|
|
Hyper text links |
A hyper text link allows a browser of the document to navigate either: to a new point in the document or to navigate to a different document. A named point in a document is specified with an anchor tag which has the attribute NAME. For example:
Formatted text | HTML
markup required |
---|---|
Here | Here |
To effect a transfer to a named anchor point, the HREF form of the anchor tag is used. For example:
Formatted text | HTML
markup required |
---|---|
Transfer to anchor | Transfer to anchor |
The # before the name of the hypertext link tells the browser that the link is to a named point in a document. As no document name is specified before the # the hypertext link is to a point in the current document. It is usual for the browser to visibly highlight the hypertext link.
Hypertext links may also link to other documents, in which case the HREF component names the document. If the file is held on another machine then a URL (Uniform Resource Locator) is used to describe the location of the document. For example:
Hyper
text link to the
file file.html |
Hyper
text link to the
file file.html held on another machine using an URL |
Name | Name |
To go to a named point in a file the format of the anchor is:
Hyper
text link to the
file file.html at point mark |
Hyper
text link to the
file file.html at point mark held on another machine using an URL |
Name | Name |
Tables |
Single cell |
A table is
created using
the The status
of the tag
markup tag. The
simplest table
consists of a
single data
cell. The markup
or other
formatting tag.
The tag
defines the
start of a table
data cell.
is
somewhat
unclear.
Netscape 1.1
requires the end
of table data
cell tag
to
terminate the
cell in certain
circumstances.
Other browsers
sense the end of
the cell by the
Formatted text | HTML
markup
required |
||
---|---|---|---|
|
|
The following extra attributes can be added to a TABLE tag:
The following extra components can be added to a TD tag:
Formatted text | HTML
markup
required |
||
---|---|---|---|
|
|
Row(s) of cells |
Formatted text | HTML
markup
required |
||||
---|---|---|---|---|---|
|
|
Formatted text | HTML
markup
required |
||||||||
---|---|---|---|---|---|---|---|---|---|
|
|
Heading to a column |
The tag
Formatted text | HTML
markup
required |
||||||||
---|---|---|---|---|---|---|---|---|---|
|
|
Spanning rows and columns |
The attributes ROWSPAN and COLSPAN of the HTML tags
Formatted text | HTML
markup
required |
||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Colouring table cells |
This can be used to give an area of text a background colour
Formatted text | HTML markup required | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Using HTML special characters |
The markup language uses the character < to start a markup tag. The consequence of this is that < can not be used to represent the less than character directly in a web page. The HTML markup languages defines an escape sequences of characters to represent such special characters.
The following are some of the character sequences used to represent characters that have a special meaning in the HTML language.
Character | Represent by sequence | Character | Represent by sequence |
---|---|---|---|
< | < | > | > |
& | & | " | " |
Thus to include
Characters not in the normal ASCII character set are also represented by an escape sequence. This is so that they may be typed on computer systems which do not directly support the input of such characters. For example:
Character | Represent by sequence | Character | Represent by sequence |
---|---|---|---|
à | à | ç | ç |
To prevent the web browser breaking a line at a space character a non breaking space character is used rather than the normal space character.. A non breaking space character is represented by the escape sequence . This can also be used to introduce more than one space character between words. For example:
HTML | Formatted text |
---|---|
A B A B |
A B A B |
In addition a character from the LATIN-1 character set is represented by nn;. Where nn represents the character code in decimal. For example:
Character | Represent by sequence | Character | Represent by sequence |
---|---|---|---|
? | | A | A |
Literal copy and centering of text |
Text can be copied literally by using the
tag. However, any HTML tags in the text will be processed. For example:
Formatted text HTML markup required
* *** ***** * *** *****
Any text to be centered is enclosed between the tags
Formatted text | HTML
markup
required |
---|---|
A
line
of
normally
formatted
text.
Some
lines
of
text that are centered |
A line of normally formatted text. |
Inserting an e-mail address |
An e-mail address may be inserted into the document using a special form of the anchor markup tag. A user selecting this will be presented with a form on which to prepare their message for eventual sending in this case to the e-mail address:
[email protected]Formatted text | HTML
markup
required |
---|---|
Mail me |
Mail me |
Of course your browser has to support this facility.
Automatic redirect |
A page may contain a tag that will cause an automatic redirection to another URL after a specific time interval. For example, the tag
will cause the current page to be automatically replaced with the contents of the URL http://domain/directory/file.html after 3 seconds.
THIS SITE WAS CREATED 27th FEB 2000