Things you want to know about websites

 

Colors

Color are an essential part of a presentation. If properly balanced, colors can greatly improve the appearance of your website.

First, lets see how colors are made in Html.

Primary Colors

The primary colors used on computer systems and also on html are

These colors are basic, all other colors are less or more combination of these colors.

Color Names

There are 16 colors specified by the W3C which you can use by name. These colors are,

Black White Yellow Gray
Silver Red Green Blue
Olive Purple Aqua Fuchsia
Teal Lime Maroon Navy

There are other color names also that are supported by browsers but they are not part of W3C specification.

Different browsers can show different shades of the same color, so the best practice is to use the hexadecimal color code.

Hexadecimal Numbers

Color codes used in html are Hexadecimal values. Hexadecimal numbers have a base of 16, meanining that there are a total of 16 differenet digits allowed.

The counting sequence goes like:

0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

now thats all 16 digits. After that the digits repeat just like decimal numbers:

10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F and so on.

Color codes

Each color is coded with 6 hexadecimal digits, with 2 digits reserved for each primary color. For hexadecimal values the sign # precedes the numeric value.

For example, in a color value of #0010FF, # represents that its a hexadecimal value, 00 is for Red, 10 is for Green and FF is for Blue.

Since each color is represented by two digits, it can have 256 different values, starting from 00 upto FF.

Selecting Codes for Colors

So how do you know which code is which color? Some are easy to see. For example a color code for red will have only a red color value and none for other colors which makes it #FF0000. Similarly green's code is #00FF00 and blue's #0000FF. For black its #000000 and for White its #FFFFFF.

For other colors the best way is to make a color in an Image editing software like PhotoShop and then look at the code and copy it into your html document.

Changing the background color

To change the background color you can use the bgcolor attribute. Although changing background color with Html is deprecated (outdated or obsolete)and W3C now encourages the use of CSS styles to change the background color, but bgcolor is still supported by browsers.

You can use bgcolor attribute with <body> tag or you can use it with table tags.

Example

<body bgcolor="#ded9d9" >

changes the background color to a shade of grey.

Changing the font color

You can change the text color by using the <font> tag with color attribute. One again font tag is deprecated but browsers support it.

Example,

<font color="blue"> This is blue text. </font>

gives you,

This is blue text.


Bookmark or Add to Favourites

Next:

Html-Images

Related:

Html-Formatting

Link to this page :

Copy and paste the following code in an html document to link to this page,