Jump to content

Background Colors


glenvern
 Share

Recommended Posts

I am trying to put a background color onto my webpages using a stylesheet and I have the identical entry that you show in your example belowbody{background-color:#a2a2a2;} But I cannot get this to work in any of the browsers.. (IE, Chrome, Firefox or Safari)My stylesheet has only this one entry in it (no other text)Should there be anything else in a stylesheet as I have never seen a stylesheet page, I have only ever seen stylesheet entries so I'm not sure if I should have anything else included.

Link to comment
Share on other sites

I am trying to put a background color onto my webpages using a stylesheet and I have the identical entry that you show in your example belowbody{background-color:#a2a2a2;} But I cannot get this to work in any of the browsers.. (IE, Chrome, Firefox or Safari)My stylesheet has only this one entry in it (no other text)Should there be anything else in a stylesheet as I have never seen a stylesheet page, I have only ever seen stylesheet entries so I'm not sure if I should have anything else included.
I know this is a really dumb question... but do you have the <style type="text/css"> and </style> tags before and after the CSS? Here is an example that works in all my stylesheets.<style type="text/css">.bgcolor {background-color: #0000FF;}</style> Hope I was some kind of help
Link to comment
Share on other sites

I know this is a really dumb question... but do you have the <style type="text/css"> and </style> tags before and after the CSS? Here is an example that works in all my stylesheets.<style type="text/css">.bgcolor {background-color: #0000FF;}</style> Hope I was some kind of help
Link to comment
Share on other sites

what is your exact code? Are you writing your CSS within the page or in an external stylesheet?
The code in my external stylesheet is -<style type="text/css">{background-color: #0000FF;}</style> No other entries only this one..I tried it in the <head> and it didn't work there eitherIt works in all other browsers just can't get it to work in Firefox.I can only get <body bgcolor> to work in Firefox but I can't use that as it would mean puting it into every page... Edited by Glenvern
Link to comment
Share on other sites

If it's in an external style sheet the only thing you want in that file is this:

body {	 background-color: #0000FF;}

If it's in the head you want something like this:

<style type="text/css">body {	 background-color: #0000FF;}</style>

Edited by jkloth
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...