Tuesday, March 3, 2009

Text Formating tags

Getting text into your web page is quite easy - just start typing between the two BODY tags. When you save your work and view it in a browser, the text will appear without any special formatting. You don't need to specify a type of font to use, or a colour, or a size. This is because browsers are set up to use defaults when no instructions are given.

Text formatting, in html terms, is when you give the browser instructions on how your text should look. These instructions come in the form of tags, and you'll learn these now.


Colour

You can specify which colour you want to use for all the text on your web page. The browser default is black, so you only really need to specify a colour if you don't want black. Here's how to do it.

*
Start your HTML Editor
*
Click File > New
*
Set a background colour and click OK
*
When you see the code, locate the first BODY tag
*
Click your cursor after the "Y" of BODY
*
Press the spacebar on your keyboard
*
Type in TEXT =
*
Then type a colour for your text
*
In between the two BODY tags, start typing you text
*
Save your web page, and then view the results
*
In the code below, the text has been set to Blue




If all you want to do is to change the colour of some text between the BODY tags, your HTML editor has a quick way of doing that.

*
Highlight the text whose colour you want to change
*
From the menu bar, click on Format > Text Colour
*
The Colour dialogue box appears
*
Choose a colour by clicking on a colour square
*
Click OK


Headings

You've already met the Headings tag. If you'll remember, the Heading tag uses the letter "H" followed by a number. Like this:

My Heading



or like this:

My Heading



The heading tag increases or decreases text size above or below the default size. The default size is 3. The biggest size is 1, and the smallest 7.

The heading tag will automatically insert a line break for you, so you don't have to insert a

or
tag after it to start a new line.

To insert a Heading tag with the HTML Editor, click on Insert > Heading then choose a Heading size. Only size 1 to 4 are used in the editor. But bear in mind, you can go as low as size 7.

When you click on a heading size, the beginning and end Tag will be inserted with the cursor flashing between the two:



The forward slash, remember, tells the browser to stop formatting a tag. In this case, stop formatting the H1 heading tag.

With the cursor flashing between the two tags, type your text for the heading.


Centring Text

To centre text (and anything else on your page), the CENTER tag is used. Note the American spelling, with "ER" at the end and not "RE". To centre something with the HTML Editor, do the following:

*
Highlight whatever you want to centre
*
From the menu bar, click on Format > Centre
*
The two CENTER tags will surround your highlighted text
*
Save your work and view the results in your browser


In this lesson, we'll continue our look at the basic text formatting tags available to you in HTML


Bold Text

You can make text stand out by using the bold tag.

*
In your Editor, highlight the text you want to make bold
*
From the menu bar, click on Format > Bold
*
The two tags will surround your highlighted text
*
Save your work and view the results in your browser

Bold Text
Italics

The HTML tag to make text italic is as simple as the "B" tag for bold text. With your HTML editor, do the following:

*
Highlight the text for the italics
*
From the menu bar, click on Format > Italics
*
The two tags will surround your highlighted text
*
Save your work and view the results in your browser


Subscript

Subscript is text that appears below normal text. Like this:

50p

You can have Subscript in your HTML code quite easily. To format text as subscript using your HTML editor, do this:

*
Highlight the text you want to turn into subscript
*
From the menu bar, click on Format > Subscript
*
The two tags will surround your highlighted text
*
Save your work and view the results in your browser


Superscript

Superscript is text that is raised slightly above the centre. Like this

24th

To format text as superscript using your HTML editor, do this:

*
Highlight the text you want to turn into superscript
*
From the menu bar, click on Format > Superscript
*
The two tags will surround your highlighted text
*
Save your work and view the results in your browser

1 comment: