1
votes

I have wordpress installed on my system. I am using twentyten theme, in the theme directory there is style.css file. In that file I tried

body {
       background-color: red;
}

but nothing happens, no matter what change in style.css it does not reflects in browser. Please help.

4
Are you sure you are changing the right style sheet? Do you see your changes in your browser when you go to "View Source" and open the style sheet manually? Are you doing this before any other body blocks?Pekka
Did you try to modify any other theme? Because Twenty-ten is made of multiple opaque DIVS. These divs are preventing you to see the RED background.Sujit Agarwal
I just noticed that after changing the style.css file and deleting the cache, if I select view source then I dont see the changes in the style.css file. But I am damn sure that I am editing the right file. Now this is strange.hsinxh

4 Answers

5
votes

Have you cleared your browser's cache? Often the browser will cache the css files to be more efficient, so any changes you make to it require you to clear the cache.

If you're using a windows machine: ctrl + shift + del should bring up the clear cache dialog

Edit: it appears that your css was in the @media print section of the stylesheet - which only applies to printed material

2
votes

The best way to figure this stuff out is to install Firebug in Firefox or use the built-in Inspector in Chrome.

Right-click on the page, do 'Inspect Element' and check what the Inspector tells you. Probably the background-color you're setting is being overruled by another style rule (Inspector will tell you this) or there are other elements with another background-color which are placed on top of the body, thus hiding the red background-color.

Either way, doing an 'Inspect Element' will make this clear. We can only guess from here.

1
votes

First of all ensure that you're editing the right style sheet. For example try to erase all the styling code inside this file and refresh your website. If you loose your style then you're in the right place.

Second try to use Firebug Addon it will help you to inspect the html Element then you can show the corresponding CSS for this element. you can change whatever you want and see the effects directly on your page then you can write these changes to the style sheet. hope it helps you.

1
votes

Maybe that style is overwritten by another background attribute on the body a few lines below (browser will always render the last css attributes of elements). Something you can check easily with firebug.

If you have plugins, disable them just to be sure.

Other then that and the suggestions already made I'm not entirely sure what could cause this