CSS Help

Hello evry one :slight_smile:
Today i have a little problem with css file.
In i link my css file and it worked… i added few things and i set style to them. Than i added
id=“main_content” and in css file #main_content{} but they didnt worked for that … Also i tried to add something down of #main_content, and it dont worked again. I had this problem before but it wasnt problem for me… .but now ?? :slight_smile:
can you help me ?

Post your code. Include relevant CSS & HTML.

Part of my css file

#logo{ background-color:white; }

[php]

[/php] Result http://img152.imageshack.us/img152/5052/148f09b2ee8144679998cca.png

If you need a full code of index html and style css i will send it to you in pm :slight_smile:

Your problem is that #logo does not have a white background?

What you should do is install Firefox, if you don’t already have it, then download Firebug add-on.

From there, you can right click any element on the page and choose “Inspect Element with Firebug”

It will show you exactly what CSS is applied to the element and you can even modify it from there.

I believe your code should be:

#logo {
  background: white;
}

Hope this helps… :smiley:

There’s no difference between using background:white and background-color:white

Using background-color is more appropriate since background is for shorthand use (if you specify color, url, positioning, etc.)

He most likely has something overriding the CSS which is why I recommended viewing it in Firebug.

Oh… ok… Did not know that…
Did u try specifying a width and a height attribute for the div. That might be a problem sometimes.

A useful thing to do when debugging problems like this is to add a border to your div’s to see how they are being positioned and sized. So try adding this temporarily to your css

#logo {border:1px solid red;}
Sponsor our Newsletter | Privacy Policy | Terms of Service