HOW TO BUILD A PROFESSIONAL WEB SITE     Rel. 1.1

LESSON 03

How to build a Professional Web Site by Carlo Scodanibbio Valid XHTML 1.0!


Hi !
First of all, a promise is a promise: the correct Solution of Exercise 01 is here, have a look at it.

And now we can start with this Lesson.


text and fonts

According to "guru" Jacob Nielsen, today's Web Sites must be "useful" and, most of all, "usable". You may wish to read Mr Nielsen's points of view at http://www.useit.com.
"Usability" and "Usefulness" are obtained mostly through the intelligent use of Text - this will become more evident in the 3rd Module of this Course. So it is very important to know how to manipulate text and fonts.

Unless you specify otherwise, normally your Browser by "default" (font default setting) will display plain text contained within your HTML code as "Times New Roman" - Size 3 (12 points) - colour: black.
The text of this lesson, for instance, is being now displayed with the Font Times New Roman, black, size 3.
Likewise all text you have so far introduced within the BODY of your "testpage" has been rendered by your Browser as Times New Roman, black, size 3 - unless you have changed the Text Size option in your Browser.

Let me explain better. First, Sizes.
In the HTML language there are 7 sizes available for each Font, numbered 1 to 7. They look something like the following:

smallest small medium extra medium large very large largest !
Size 1 Size 2 Size 3 Size 4 Size 5 Size 6 Size 7

As already said, Size 3 in Browserese language corresponds (approximately) to 12 points in Word Processor language.

And now, Fonts.
There are millions of Fonts to choose from. These below are just some examples:

arial
comic
courier
impact
matisse
sanserif
ocra
parisian
tnroman
traffic
vandijk
verdana
westminster

It is possible to change the Font Default Setting instructing a Browser to display, rather than Times New Roman - black - size 3, any other Font of another size and of another colour. But, there is a but - I will tell you about it further down.

To use a different Font, and/or a different Size, and/or a different Colour, the new TAG to be used is <FONT>. The text to be rendered in a different style is positioned between the <FONT> opening Tag and the </FONT> closing Tag

The FONT Tag takes three ATTRIBUTES:
FACE     to specify the Font type
SIZE       to specify the Font size
COLOR to specify the Font colour (note the American spelling: COLOR, not COLOUR)

You may specify only one ATTRIBUTE in a TAG, a few, or all of them, always separated by a space. For instance, if you wish your text to be displayed in Arial, size 5 and red, you will need this code:

<BODY BGCOLOR="#FFFFFF">
<FONT COLOR="#FF0000" FACE="Arial" SIZE="5">
A different Web Page !!! </FONT>
</BODY>

The resulting Page will look like this:

img

Better, don't you think so ?
A few comments:

Another Remark.
When your HTML coding is rather long, like in this case, and/or your string of text is long, Notepad will automatically insert "horizontal scrolling bars" to allow you to see what you are writing. Like for instance:

img

img

Scrolling left and right might be a bit annoying, so there is a solution.
All you have to do is to set your Notepad for "auto-wrapping" - to get that, just go to Edit and choose Wordwrap (it must be "ticked"). When your string of text and HTML code is so long that it will hit the right wall of Notepad window, Notepad will just create a new line automatically: you will not get lost in what you are writing and I will have total peace of mind.......

img

img


And now: the BUT I was mentioning earlier.
You may choose any Font you have installed in your Computer, and your Browser will display your text in the selected font types, but remember: your visitors browsing through your pages will be able to see your fancy fonts only if they have them installed in their computers !
Alternatively, your visitor's Browser will make some quick calculations (very unpredictable) and display the Font that, to its browserese opinion, will be the closest to the one you have selected !
In conclusion, don't go crazy with fonts....... You will notice that the bulk of Web Pages text is displayed in one of the following Fonts:

The reason is that those Fonts are most definitely installed in practically all Computers in the world, including very old Computers having Windows 3.10 or 3.11 as Operating System.
So, the simple rule: stick to the above Fonts if you do not want to get surprises - what you need to achieve is total control over what any Browser of any version will display in any Computer !
Further down I will be more specific about the type of surprises you would otherwise get.

You may, however, use an HTML little trick to give more options to your Visitor's Browser, by setting the FACE Attribute in the FONT Tag to "more than one value", i.e. you may specify more than one Font, like in the example below:

<BODY BGCOLOR="#FFFFFF">
<FONT COLOR="#FF0000" FACE="Impact, Comic, Verdana, Arial" SIZE="5">
A different Web Page !!! </FONT>
</BODY>

hot, hot, hot...
TIP
If you specify multiple Fonts, test your work for ALL the Fonts you have set, one by one.
Make sure the last Font in the range is either Times New Roman, or Arial, or Helvetica, or Courier....

      What will happen ? If your Visitor's Browser will find the "Impact" Font installed in the Visitor's Computer, then he will display your text in Impact style. If not, the Browser will look for the next alternative, which is "Comic". If available, your text will be displayed in Comic style. If not, etc.etc. Eventually, as last alternative, Arial will be utilised to display your text.
Please note the comma and one space between each different FACE value (between each Font style).
What is the advantage of specifying more than one FACE value ?
You have more control on what will happen in your visitor's computer. You may then design your page using the Impact Font, but you will also test it with Comic, and Verdana, and Arial, to make sure that your hard work will appear to everybody as intended to be, or, at least, it won't look too idiot.....
In conclusion, you minimise the risk that your Visitor's Browser will go for "any" Font, probably Times New Roman, uncontrolledly.

You might want to apply the FONT Tag only to part of your text, like this:

<BODY BGCOLOR="#FFFFFF">
This is a beautiful <FONT COLOR="#FF0000" FACE="Arial" SIZE="7">Web Page !!! </FONT>
</BODY>

which will result in this:

img

or like this:

<BODY BGCOLOR="#FFFFFF">
This is a <FONT COLOR="#0000FF" FACE="Arial" SIZE="5">beautiful </FONT><FONT COLOR="#FF0000" FACE="Arial" SIZE="7">Web Page !!! </FONT>
</BODY>

which will result in this:

img

Exciting, isn't it ?

REMARKS:
You may notice that every time there is a change in Font style I open and close the FONT Tag to take control of every change.
This is not always necessary. For instance, in the last example, I might have written my HTML code as follows, and it would have worked just fine:

<BODY BGCOLOR="#FFFFFF">
This is a <FONT COLOR="#0000FF" FACE="Arial" SIZE="5">beautiful <FONT COLOR="#FF0000" SIZE="7">Web Page !!! </FONT>
</BODY>

BUT, don't do it !!!!
The second FONT opening Tag "takes over" the Arial FACE from the first one, which normally is accepted by modern Browsers, but I cannot give you any guarantee it will work under any condition.
Moreover, the HTML closing syntax is wrong ! One </FONT> closing Tag for two <FONT> opening Tags is supported (or, better, "tolerated") by modern Browsers, but is not according to HTML standards.
Finally, such coding might not work at all inside a "Table" (Lesson on Tables coming up soon): both Netscape and Explorer might go completely berserk.....
So, always stick to the golden rule for the FONT Tag: always open it "in full" (with all necessary Attributes) and close it at each and every Font style change and you'll never go wrong !
After all it's just a matter of "copy and paste" for the FONT Code.....

Hoh, hoh, I was almost forgetting: it is Exercise Time !!!!.

EXERCISE 02
whynot
Try to make a Web Page that looks similar to this:

img

The solution is coming, as usual, with the next Lesson.



When I have some time, I enjoy playing with Tags and Attributes to make cute gadgets like the following:

 h a s t a   l a   v i s t a,   b a b y.....

or like this:

 T E C H N I C O L O R

or like this:

 r a i n b o w

Are you more impressed now ?
Test yourself, if you wish, practising on exercises like those above, then you may see the HTML codes here




Let's go ahead with this Lesson.

physical style tags

You may make your text (or part of it) BOLD.
The STARTING TAG is : <B>
The CLOSING TAG is : </B>
Whatever text is between the two Tags is rendered Bold.

For instance (I am changing Background and Font style in each of the following examples otherwise you get bored):

<BODY BGCOLOR="#FF00FF">
<FONT COLOR="#FFFF00" FACE="Times New Roman" SIZE="7">

Some more <B>text</B>
</FONT>

</BODY>

Your Page will look something like this:

img


You may make text (or part of it) ITALIC.
The STARTING TAG is : <I>
The CLOSING TAG is : </I>

For instance:

<BODY BGCOLOR="#00FFFF">
<FONT COLOR="#FF00FF" FACE="Verdana" SIZE="6">
<I>
Some italicised text.....</I>
</FONT>
</BODY>

Your page will look something like this:

img


Or, you may make text (or part of it) UNDERLINED.
The STARTING TAG is : <U>
The CLOSING TAG is : </U>

For instance:

<BODY BGCOLOR="#CCCC00">
<FONT COLOR="#0000FF" FACE="MS Sans Serif" SIZE="6">
<U>
This text is underlined </U>
</FONT>
</BODY>

This is what comes out:

img


You may have your text rendered "STRIKE THROUGH"
Assuming you like this peculiar style (hardly found on the Web), what you need is:
<STRIKE> as Starting Tag
</STRIKE> as Closing Tag
or
<S> as Starting Tag
</S> as Closing Tag

For instance:

<BODY BGCOLOR="#00FFCC">
<FONT COLOR="#0000FF" FACE="Arial" SIZE="5">
<S>
Fancy strike through text </S>
</FONT>
</BODY>

This is what will be displayed:

img


You may CENTRE your text (or part of it) in the Browser window.
The STARTING TAG is : <CENTER>
The CLOSING TAG is : </CENTER>
Careful with the American spelling !!

For instance:

<BODY BGCOLOR="#0000CC">
<CENTER>
<FONT COLOR="#FFFF00" FACE="Times New Roman" SIZE="6">

This is centred text
</FONT>
</CENTER>
</BODY>

which will result in this:

img

I guess you might have a question buzzing around in your mind: "...must the FONT Tag be contained within the CENTER tag, like in the example, or could it be vice-versa ?"
Well, the issue is simple, but it is too early to explain it in detail. Let me just tell you that Browsers could not care less for the way you position the two Tags, relative to one another - Browsers will still display well your content.
However, the right and correct way is to have your CENTER tag outerly and your FONT tag innerly: this will become clear in Lesson 5 and subsequent ones.
For the time being, just take it for granted..... c'est la vie !


Obviously you can use a combination of the above "Physical Style Tags" (as they are called) as you wish (but remember to position the CENTER Tag outermost and to respect the nesting rules....).

For instance:

<BODY BGCOLOR="#00CC00">
<CENTER><FONT COLOR="#FF0000" FACE="Courier New" SIZE="6">
<B><U>
A better Web Page !!! </U></B></FONT></CENTER>
</BODY>

which will be rendered like this:

img

Note: you can centre (or underline, make italic, etc.) a single letter, a single word, a sentence or part of it, or the whole Page.
Everything between the two CENTER Tags gets centred - any text between the pair of B Tags is rendered Bold - and so on - it's up to you to decide.....

For instance:

<BODY BGCOLOR="#00FFCC">
<CENTER><FONT COLOR="#CCCC00" FACE="Impact" SIZE="6">
A better <I>Web</I> <U>Page</U> !!!</FONT></CENTER>
</BODY>

will get you this:

img

REMARKS:
Do not forget TAG nesting, or you will totally confuse your Browser !
Example:

<TAG1><TAG2><TAG3> ............... </TAG3></TAG2></TAG1> is OK - but
<TAG1><TAG2><TAG3> ...............</TAG1></TAG2></TAG3> is not OK



A sometimes useful type of text effect is obtained through the "mono-spaced" Font, or TeleType Font (it is very similar to a Typewriter Font: each letter uses the same amount of horizontal screen space).
To obtain this Font there is a special
STARTING TAG : <TT> and
CLOSING TAG : </TT>

I will tell you at a later stage some possible uses for the TT Tag.
Now an example:

<BODY BGCOLOR="#FFFFFF">
<CENTER><TT>
This is Tele Type Text</TT></CENTER>
</BODY>

which will display like this:

img

Too small ? You can Insert the TT Tags within a FONT Tag using the Attribute SIZE:

<BODY BGCOLOR="#FFFF00">
<CENTER><FONT SIZE="6"><TT>
Bigger Tele Type Text </TT></FONT></CENTER>
</BODY>

And this is what the Browser displays:

img

Please note, once again, that the CENTER Tag may contain the TT tag, NOT vice-versa.
The FONT Tag may contain the TT Tag AND vice-versa.
This will become clear in Lesson 05.....


Well. well, well, let's make the point: now you know how to manipulate text, fonts, sizes, colours, etc. - which is quite a lot in such a short time, isn't it ?
I strongly believe time is ripe for another Exercise.

EXERCISE 03
whynot

Build a Web Page that looks like the following one (Achtung ! The sentence "Oh, Boy !!!" is NOT fully underlined, heh, heh...):

img

The solution is in the next Lesson.

Hard enough for you ?
Well, I told you it would have been hard, at least in the beginning.
But, don't feel depressed, now I am going to give you some good news.

Ciao, ciao, ciao, see you soon !!!


Lesson 02go back to Lesson 02 - if you have already forgotten everything... shut-down this lesson ! go to next lesson - if you still have enough energy....Lesson 04



Plan of Lessons
welcome Module 1 - Lesson: 01 02 03 04 05 06 07 08 09 10
Module 2 - Lesson: 11 12 13 14 15 16 17 18 19 20
Module 3 - Lesson: 21 22 23 24 25 26 27 28 29 30



http://www.scodanibbio.com/webbuild


go to the top of this page

A simple Copyright statement:
You are granted a nontransferable, personal license to use this Course on one computer station.
You do not become the owner of the Course nor do you have the right to copy (electronically or by any other means), transfer to third parties, or alter any part, code or content of this Course.