Send a suggestion!

We're building a brand new version of the site, and we'd love to hear your ideas

Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 23,128 times

Contents

Related Categories

Beginning HTML - Colours

LouisRose

Colours

As well as accepting a face parameter, the font tag also accepts a color (remember that HTML uses American spellings) parameter. This is used in a similar fashion to the face parameter. The value that you pass the parameter can be one of two types, either a # followed by the colour's hex code or the HTML name of the colour. For a list of colours, their HTML names and hex codes, see the bottom of this page.

For now let's just try formatting some text red. We would have to use the following code:

This text is not red. <font color="red">This text is red</font>

Try pasting this into your index file, so that it reads:

<html>
<body>
This text is not red. <font color="red">This text is red</font>
</body>
</html>

Save and refresh. For an exact shade, always use a colour's hex code equivalent, but it's obviously easier to remember a colour's textual name. The body tag also accepts a parameter called bgcolor, this sets the background colour of the page and is used in an almost identical fashion as the font color parameter. Try experimenting with it. Here's some example code:

<html>
<body bgcolor="tan">
This text is not red. <font color="red">This text is red</font>
</body>
</html>

For a full list of colours, see this excellent resource from HTML Goodies: Colour List

Comments

  • want a RTF to HTML software

    Posted by pkn on 15 Feb 2005

    Hi All,
    I have Registered in ur site, becs i want a Free HTML conerter software. if it is not available in ur Company then give the address where i down load it. i want to use it personally.

    ...

  • Sequel

    Posted by LouisRose on 18 Jan 2003

    Hi all,

    Sorry I've been away for so long. But I may be back soon. Does anybody really want a sequel? If so what do you want in it. Anything in particular? Post here or mail me and I'll include it, ...

  • Feedback ...

    Posted by keyz88 on 27 Dec 2002

    Thanks for presenting "the beef", with none of the fat (or fluf) ...

  • HTML - beginner tutorial

    Posted by kkiffe on 30 Nov 2002

    Just what I needed! Thank you very much!

  • HTML Tutorial

    Posted by DotZip on 22 Jul 2002

    Anyone just starting out coding HTML should read this. Clearly and logically presented. 100%.

    DotZip :D