|
|
You'll also find more hints and tips in the FAQs section of the Guide.
<body> and <font color> commands. For example,
<body bgcolor="#ffffd8" text="#000000" link="#0000ff" vlink="#ff0000"
alink="#00a000">
is used for this page, ie. a cream background, black text, blue unvisted links, red visited links and green active links.
<font color="#00a000">green</font>
will produce green text.
In all cases, the colours are described using a six digit red-green-blue (RGB) hexidecimal code.
This is slightly easier than it sounds.
The first two digits represent the red portion of the colour, the second two for green and the last two for blue. The valid range for each colour is from 00 (dark) to FF (light). For instance, here are some common colours in hex form:
Colour R G B
Red: ff0000
Green: 00ff00
Blue: 0000ff
Magenta: ff00ff
Purple: 9900dd
Light Gray: bbbbbb
If there is a colour, in a graphic say, and you wish to know its RGB constituents you can use a package such as the excellent Paintshop Pro to determine the split. The colour fractions will be given in decimal rather than hexidecimal. This means the
colours will range from 0 to 255 rather than 00 to FF; use a scientific calculator to convert or check out my hex to decimal conversion chart which should also help you to count in hexidecimal if you're not sure how to.
With Netscape 2 and MS Internet Explorer, you can
describe colours in terms of a name, ie. "red" instead of "#FF0000". It should be noted that
while Netscape supports 140 colour names, Internet Explorer supports only 16 of these.
Currently no other browsers support colour names. A complete colour chart is available, telling
you allowable colour names , their associated hex code and an demonstration of the colour
itself.
It is also possible to trigger a sound file to automatically play when a page is loaded. This is
done by use of the Replace MS Internet Explorer and NCSA Mosaic, simplify this
procedure with use of the
A new tag,
An alternative method is to use the command
Meanwhile, here are some examples.
Incidentally, a non-breaking space can be quite useful as it enables you to insert a space-character anywhere and as many times as you want; I used four in a row to indent the first line of this paragraph. Bear in mind that there are better ways than this for general spacing and alignment of text (such as tables or If your Internet service provider (ISP) lets you run cgi-scripts on their web server, you could make your own counter based on code available at Matt's Script Archive.
This will produce the following line of text: Last
updated 12/03/96 16:51:38
Once you've created your button, cut and paste the following JavaScript into the code for your webpage (this is only required for the form button):
![]()
<a href="SOUNDS/BLAKMEAT.WAV">
<img src="GRAPHICS/SOUND.GIF" border=0 width=36 height=28 alt="sound
button">
"I think it's time for you boys..." [64K]</A>
![]()
"I think it's time for you boys..." [64K]
<meta>
element. Include the following line of code in the <head> section
of your document.
<meta http-equiv="refresh" content="0; url=sounds/flesh.wav">
sounds/flesh.wav with the address of your own sound file.
Click here for an example.
<bgsound> element. Mosaic
only supports <bgsound> to a limited extent - the Mosaic-only
element <sound> can be
used for more control. Netscape 3 supports neither
<bgsound> nor <sound>, instead you
must use the <embed>
element. The following lines of code will all play background sound on MS Internet
Explorer, NCSA Mosaic and Netscape 3
respectively.
<BGSOUND SRC="sounds/blakmeat.wav">
<SOUND SRC="sounds/blakmeat.wav">
<EMBED SRC="sounds/blakmeat.wav" AUTOSTART="true" HIDDEN="true"></EMBED>
<TABLE WIDTH=100%>
<TR><TD WIDTH=50%>
Left hand column text in here.
<TD WIDTH=50%>
Right hand column text in here.
</TABLE>
Remember, the left hand column will not wrap into the right hand column as with normal
word processors; you must specify the columns' text separately.
<multicol>,
has been developed to make the above procedure easier. It is currently only supported by
Netscape 3. The code to produce the above would be:
<MULTICOL COLS=2 WIDTH=100%>Left hand and right hand column
text in here.</MULTICOL>
<pre>. This uses a fixed-width
font to display the text, and also shows all space-characters typed in the HTML code; thus
facilitating the alignment of text.
&) and a semi-colon (;). For instance, to display the symbol <, you need to write the code <. A full list of available symbols is available here.
< <
> >
& &
æ æ
© ©
non-breaking space
<pre>).
stats for this page
stats for this page
<script language="JavaScript">
<!---//hide script from old browsers
document.write( "<br>Last updated "+ document.lastModified );
//end hiding contents --->
</script>
The date and time marked in red will update
automatically. Please don't write to the Guide with questions about JavaScript - you'll just get a (perfectly honest) 'I don't know' answer.
Type
Code
Example
Form button
<FORM>
<INPUT TYPE="BUTTON" NAME="GOBACK" VALUE="Go Back"
OnCLick="retrace()">
</FORM>
Text link
<A HREF="javascript:history.go(-1)">Go back.</A>
<A HREF="javascript:history.go(1)">Go forward.</A>Go back.
Go forward.
A word of warning: Please don't write to the Guide with questions about Java or JavaScript - you'll just get a (perfectly honest) 'I don't know' answer...
<SCRIPT LANGUAGE="JavaScript">
<!--
function retrace()
{
history.back()
}
// -->
</SCRIPT>
|
Sizzling HTML Jalfrezi | |
| ©1997 Richard Rutter | ![]() | |
| rrutter@woodhill.co.uk | ||