...

View Full Version : backround color in HTML



the_bob
01-18-2004, 11:59 PM
i'm very new at HTML. Is there a way to change the backround color of a page with it?

Willy Duitt
01-19-2004, 12:20 AM
Try this:

<body bgcolor="#FFFF0F">
<a href="javascript:void(document.bgColor=prompt('Background Color','#C0C0C0'))">
Change BgColor</a>

.....Willy

freak
01-19-2004, 12:55 AM
It's a lot better and easier to use CSS.

Just put the following snippet inside your <head>



<style type="text/css">
body {
background: #ff0;
}
</style>


// freak

the_bob
01-19-2004, 02:36 AM
thanx, those work great! since freak's looked a little shorter I used it, but, if yellow isn't my color, what do I change to change the color?

Willy Duitt
01-19-2004, 03:42 AM
Oh, I thought you wanted to change the background color once the page was displayed. :o

To change the background color in freaks example.
Change the hexidecimal number highlighted in red

eg: background: #ff0;

You can find some additional color values here (http://www.pixy.cz/apps/barvy/index-en.html).

......Willy

Boxhead
01-19-2004, 02:11 PM
the_bob

Have a look at the tutorials on www.w3schools.com

They are very quick and easy and are broken down into individual bitesize sections

Give them a shot - you won't look back!!

Monkey

[edit:] Fixed your link url ... had an extra dot (.) :)

spufi
01-19-2004, 08:59 PM
Here's some more CSS basics and I would highly recommend you to use external CSS vs. internal.

http://www.webdevfaqs.com/css.php

iKwak
01-20-2004, 09:43 AM
Thanks for that link. It is resourceful.

the_bob
01-20-2004, 08:30 PM
ya, i just checked those out. Great sites! thanx



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum