| Site Map | WizTools.org | jCraze Blog |
![]() |
Subhash's Guide to Color Coding - II: Add ColorBackgroundBackground color/picture should not be painful to the eyes. Light color/picture is preferable(not always although!) and the text should be readable. Background ColorIn the <body> tag add the attribute: bgcolor="color-value" Now the <body> tag looks like: <body bgcolor="color-value"> If you do not know what color-value is, check out the Color Guide I. Background GraphicsTo the <body> tag add the attribute: background="path/to/the/graphic" Now the <body> tag looks like: <body background="path/to/the/graphic"> The graphic format supported currently by major browsers are JPG, GIF & PNG. The graphic will tile using this method. And yes, you can keep animated gifs as background(yuck!). Non-Tile BackgroundAttach the following CSS code to the <body>: background-image: url(path/to/the/graphic); background-repeat:
no-repeat The graphic wll be placed in the top-left corner of your document. Other values the attribute "background-repeat" can have are "repeat-x" (one horizontal stripe of background image displayed in the top), "repeat-y" (one vertical stripe of background image displayed from the top) and "repeat". Non-Scroll BackgroundThis can be achieved by this CSS code (which should be attached to the <body> tag): background-attachment: fixed The other value for this attribute is "scroll". Text ColorTo change the default text color of black, include the following attribute in the <body> tag: text="color-value" You also have the independence to change the default font & the size of such font: <basefont face="font-name" size="size number"> This is a singleton tag & it can be placed within the <body> element. Using <font>The <font> tag can be used to change the color, font & size of text. Consider I have the following text: Subhash is a good boy! Now if I have to make the word 'good' blue, I did put the code as follows: Subhash is a <font color="blue">good</font> boy! The result is: Subhash is a good boy! The <font> tag can be used for interesting effects:
In the above example each letter is wrapped in a <font> tag using the color attribute, each having a different color value. The simplicity & advantages associated with CSS (Cascading Style Sheets) has virtually replaced the usage of the <font> tag. Using CSS the 'Subhash is a good boy!' example can be written as follows: Subhash is a <span style="color:blue">good</span> boy! Link ColorTo change the link color include the following attributes to the <body>:
The same can be achieved in CSS thus: a:link{color:color-value} "color-value" should be replaced by the actual color code or name. While you browsed you would have seen links that change color when you bring the mouse over it. For achieving this, just add this code in your CSS declaration: a:hover{color:color-value} |
[Quick Stats: Number of main threads: 1, Number of sub-threads: 0]
Sign Guestbook
|
Who is Subhash?
The contents of this site are copyright© 2000-2008, indiWiz.com. All Rights Reserved.