Click to See Complete Forum and Search --> : Color!!!!!!!


Hidden Master
07-08-2003, 08:52 PM
Does anyone know how to make backround color on a webpage? :confused:

Someone once told me but it didn't work. :mad:


Please Help :(

Khalid Ali
07-08-2003, 08:58 PM
add the following code in any element for which you want to change a background color

style="background-color:lightyellow;"

Hidden Master
07-08-2003, 09:03 PM
Thanks for the effort but it didn't work

Khalid Ali
07-08-2003, 09:20 PM
You did not implement it correctly.

post your implemented code here

starrwriter
07-08-2003, 11:51 PM
I had to read this posting after seeing that many exclamation points!

With apologies to the CSS drones, you don't have to use CSS to set page background color. Just substitute whatever color you want for "white" in this:

<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">

Khalid Ali
07-09-2003, 01:28 AM
I am a firm believer of moderation,however,I'd rather start doing things in a way that will help me in future, and not do things only because it works today, as much as it possible without compromising too much.
yes ofcourse bgcolor can be used as yet,but its deprecated already so I am sure in a year or 2 the page written this way will need upgrading...now would you like to recomend an almost obsolete method to some one who needs help or give them the best possible advice??

Here is the link at w3c see what they have to say about bgcolor
http://www.w3.org/TR/html4/present/graphics.html#adef-bgcolor

best choice I'd say is to use style="background-color:lightyellow"

lightyellow should be replaced with the color of your choice.

Jeff Mott
07-09-2003, 01:29 AM
you don't have to use CSS to set page background colorNo you don't, but background-color is a property that has been supported for a long time now. It is better than to use deprecated HTML.CSS dronesYes. We really shouldn't embrace new technologies. Do away with them all. Back to 8-Track tapes! With apologies to the CD/DVD "drones". ;) :p

<body style="background-color: silver">And as Khalid already mentioned, this can be applied to any element (a property not shared by the HTML bgcolor attribute).