Great Templates

FEATURED WEB TEMPLATES

Amazon Books

Learn PHP

PHP Training
Zend Cert Training Zend Certified Engineer Zend PHP Pro

HTML Hyper Text Markup Language: Create And Format Text In HTML

Creating and Formatting Text

Being able to create and format text the way you want it to appear on a web page is the very essence of HTML. There are several tags that will allow you to display your text:

The Tag

The Tag is designed to let you create and make modifications to the text on your page but you have to decide which of the Tag attributes you need. These are some of the attributes for this tag:

SIZE="1-7"
This attribute will let you enter text sizes from 1 to 7. If you do not enter a specific size \'value\' the text will default to a size of 3. 1 is the smallest text size, and 7 is the largest.

SIZE="2">testing the font size

Now change the 2 to any number between 1 and 7. See the difference?

FACE="Font name here"
This attribute will let you define the font you want the text to appear in. If you specify you want your text to show up in Arial, for example, and the person viewing the page doesn\'t have the Arial font installed on their system then the text will show up in whatever font they have defined as the default font in their browser.

Here is the correct way to use the FACE= attribute:

FACE="Arial">testing the face attribute

Lets say I want to have text show up in Arial, but I know some people don\'t have Arial, so I want to define a secondary font that they might have. This is easy to do... just type in another font name and separate the two with a comma, like this:

FACE="Arial,Verdana">testing the face attribute

In this example, if I dont have Arial, then the browser will try to show the font in Verdana. If I dont have Verdana, then the text will be displayed in my browser\'s default font.

COLOR="Color Code or Name here"
This attribute lets you define the color you want your text to appear in. You can use a 6 character color identifier (Hexadecimal Color Code) or the Name of a color.

Try this example on your web page:

COLOR="black">testing the color attribute

This will give you black text. However, you can also use a 6 character Hexadecimal Color Cod to define the color you want. Try this on your web page:

COLOR="#000000">testing the color attribute

This will also give you black text.

Text Formatting Tags

Once you have decided on the size, color and font you wish to use, you can further modify your text by applying one or more of these formatting tags:

Text Formatting Tags: Tags will display:
This text is bolded This text is bolded
This text is italicized This text is italicized
This text is underlined This text is underlined
This is typewriter text This is typewriter text
This is subscript This is subscript (H2O)
This is superscript This is superscript (ESSOTM)

Special Characters

Some characters will not be shown unless you tell the browser to show them, and some characters are not on the keyboard, so you have to use a "special character" to tell the browser what to display. The character will start with an ampersand (&) and finish with a semicolon (;). These are also case sensitive, so do not use capital letters.


© ©
® ®
< <
> >
« «
» »
½ ½
é é

Here are a few common special characters, and if you want a complete list, go here.

The most common special character is a blank space.

If you simply hit the space bar between two words, only one space will show up. If you want several blank spaces between words, you have to use the \'non-breaking space\' special character:  

So if I wanted to space out these two words, I would type this:

Hello       Goodbye

and the result would be: Hello Goodbye

Using Color On Your Web Page

In HTML we use Hexadecimal Color Codes [based on RGB values] or Color Names to insert colors into HTML documents.

Hexadecimal Color Codes

The Hexadecimal Color Code consists of 6 numbers and/or letters, combining to give you over 14 million possible colors, shades, hues and tints.

The 6-number-and/or-letter combinations are actually 3 pairs of values where RR, GG, BB are the hexadecimal digits specifying the Red, Green, and Blue values of the color. This value is written as #RRGGBB. The number values range from 0 - 9; letter values range from A to F.

Here is an example of a Hexadecimal Color Code:

COLOR="#0000FF">Here is some example text I want to color

The above line of code will display the example text in blue like this:

Here is some example text I want to color

Color Names

Colors can also be specified by their official Color Name. Originally there were 16 Color Names, picked as the standard 16 colors supported with the Windows VGA palette. Today there are hundreds of standard colors with official color names.

A Color Name is used in this format:

COLOR="blue">Here is some example text I want to color

The above line of code will display the example text in blue like this:

Here is some example text I want to color

Both methods are perfectly legitimate methods of defining HTML colors but the Hexadecimal Color Code system will give you a much wider range of possible color choices.


 


Learn PHP | Zend Certified Engineer | Zend PHP Pro | PHP Web Apps | Web Hosting Service | Low Cost Domain Names | Great Templates | Great Books | Testimonials | Tech.Articles | TOS | AUS | Home | Linux Apache MySQL PHP