Wells-it.com - Web Hosting

CSS background colour

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.

They have: 42 posts

Joined: Jan 2005

Hi

How do I have a page where the background is determined in a a CSS file? I'm getting familiar with CSS but can't work this one out!

Harvey

James

dk01's picture

He has: 517 posts

Joined: Mar 2002

Put this in the of your document:

Then in mystyle.css you need to put this:
body { background: #ffcc00; }

You can edit #ffcc00 to match whatever color you want.

-dk

They have: 42 posts

Joined: Jan 2005

Yes, but I need different backgrounds on different pages. Hmm.

Oh well, I'll just do them individually.

James

They have: 1 posts

Joined: Mar 2005

or
body.style1 {background:#fff}
body.style2 {background:#ffc}
body.style3 {background:#fcf}
in the style sheet
and for each page add a class attribute to the body tag
like

HTH