• No results found

PARADOXES 175 13 Write a program to allow you to compare the strategies play-the-winner and

In document Introduction to Probability (Page 185-187)

Beta Density

4.3. PARADOXES 175 13 Write a program to allow you to compare the strategies play-the-winner and

UNIT 24: HTML — Text Formatting Properties

1.0 Introduction

If you had an entire web page without formatted text, it would look rather dull and boring. In this unit, we will be looking at text formatting tags.

2.0 Objectives

 At the end of this unit you should be able to:

 Create a paragraph in your document;

 Centralize and right align text in your dodument;

 Change font size and font.

3.1 Paragraphs

You will often use paragraphs in HTML, just as you do when you write stories. The opening tag for a paragraph is <p>, and the closing tag is <p>. The closing tag for a paragraph is not always needed,

but I recommend using it anyway.

Example of a paragraph.

Shidinje can stand on her own while holding something to support her. She will not want to try standing without leaning on an object for fear of falling own.

Shidinje can stand on her own while holding something to support her She will not want to try standing without leaning on an object for fear of falling own.

Exercise

1

Does the paragraph need a closing tag?

As mentioned above, the closing tag for a paragraph is not always needed.

3.2 Font Size Commands

Maybe you'd like a little more control over your text size. The <FONT SIZE> commands. Heading commands are great for right at the top of the page.

There are twelve (12) font size commands available to you: +6 through +1 and -1 through -6.

As you've probably guessed, +6 is the largest (it's huge); -6 is the smallest (it's a little too small).

Here are a few of them in action. There's no need to show all of them. You'll get the idea of their relative sizes. Follow this pattern to place one on your page.

<FONT SIZE= "+3"> This is +3</FONT>

<FONT SIZE= "+1"> This is +1</FONT>

<FONT SIZE= "-1"> This is -1<FONT>

<FONT SIZE= "-6"> This is -6</FONT>

Notice that this first command, <FONT SIZE= "--"> is actually doing two things:

1. It's asking for a new font size...

2. Then offering a number to denote the font size.

This is what I like to call a command inside of a command. The technical HTML term is an

"attribute". When you have that, you denote the attribute with an equal sign and enclose it within quotation marks. Look above. See the equal sign and the plus or minus number in quotes? That's what I'm talking about.

Example of font tags...

Sharon is a Lovely baby isn't she?

<font size=+1> Sharon </font size:+2> is </font> <font size=+3> a </font> <font size=+2> lovely </

font> <font size=+1> baby </font> isn't <font size=-1> she? </font>

Also notice that the end command for a <FONT SIZE= "--"> tag only requires </FONT>.

Remember that an attribute is inside of a tag. When you use an end command, you are closing the tag, not the attribute. So you only need the one end tag, like above.

Activity

Write a font tag for this text.

Shidini.! is a darling

The newest version of many browsers supports extended fonts, in which you can choose to have the document fonts other than the normal one. This is accomplished by adding the FACE="font name"

attribute to the <FONT> tag. The most commonly supported fonts are Verdana, Anal, Helvetica, Impact, Comic Sans MS, and a few others. It is not recommended to make your page font dependent, because the older versions of many browsers don't yet support this feature.

Examples of Exten ded Fonts. ..

<font size=+2 face= "Verdana"> Verdana</font>

Verdana

<font size=+2 face= "Adal">Arial</font>

Anal

<font size=+2 face= "Helvetica"> Helvetica</font>

Helvetica

<font size=+2 face-- "Impact"> Impact</font>

Impact

<font size=+2 face= "Comic Sans MS"> Comic Sans MS</font>

Comic Sans MS

3.3 Text Color

You can change the color of the text by setting the

COLOR

="font_color" attribute in the

<FONT>

tag. The Color is usually set by using the hexadecimal system (#000000 black to

#FFFEFF white) but can also be set in newer browsers by using the simple word of the color. (Red for Red. Blue for Blue, etc.)

Example of Text Color...

<font color= "Blue"> Hey I'm Blue!</font>

Hey I'm blue!

<font size=+2 face= "Impact" color= "Green">Hey I'm green and in Impact Fontl</font>

In document Introduction to Probability (Page 185-187)