glenvern Posted March 11, 2010 Share Posted March 11, 2010 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 More sharing options...
psutherland2012 Posted March 11, 2010 Share Posted March 11, 2010 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 More sharing options...
glenvern Posted March 11, 2010 Author Share Posted March 11, 2010 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 More sharing options...
glenvern Posted March 11, 2010 Author Share Posted March 11, 2010 I replaced my stylesheet entry with yours - made no difference still not working in any browser..(where did the .bgcolor come from it didn't show that in your css example page) Link to comment Share on other sites More sharing options...
thescientist Posted March 11, 2010 Share Posted March 11, 2010 what is your exact code? Are you writing your CSS within the page or in an external stylesheet? Link to comment Share on other sites More sharing options...
glenvern Posted March 11, 2010 Author Share Posted March 11, 2010 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... Link to comment Share on other sites More sharing options...
ShadowMage Posted March 11, 2010 Share Posted March 11, 2010 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> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.