css background image problem

He has: 388 posts

Joined: Apr 2005

For some reason in firefox the backgroundimage for my div #container dos not show up but it works fine in ie

here is the page in question http://darkscripts.111mb.com/darkscriptsindex.htm

hope you can help me

SearchBliss's picture

He has: 267 posts

Joined: Feb 2005

I use IE, but you may want to try this:
#container {
background-image: url(bg.jpg);
margin: 0 auto;
width: 720px;
}

and see if that works. Just a guess.

demonhale's picture

He has: 3,278 posts

Joined: May 2005

the problem here is that you floated the div.content-container and div.banner-container which holds inside their div class your texts... wherein the both of them is handled inside a div id #container... The quick fix I could think of is this...

Quote:
#container {
background: url(bg.jpg);
margin: 0 auto;
width: 720px;
height:1500px;
}

but if I were you you should delete the float and absolute position your navigation so that the Background in the container stretches as your content increases... depends on you...

Roo's picture

She has: 840 posts

Joined: Apr 1999

Try validating your code:
Your code errors

Also try quote marks like this:

#container {
background: url('bg.jpg');
margin: 0 auto;
width: 720px;
}

Roo

He has: 388 posts

Joined: Apr 2005

Thanks demonhale that fixed it right up.

He has: 388 posts

Joined: Apr 2005

deamonhale your suggestion did fix it but then i had to manuly enter the hight of each page. I did some research on this and found somthing out if you have a floated div within a container and the container wont surround your floated div all you have to do is add overflow: auto to the container and it works.

just incase anyone else comes upon this problem

He has: 388 posts

Joined: Apr 2005

here is the article about it http://www.quirksmode.org/css/clearing.html

demonhale's picture

He has: 3,278 posts

Joined: May 2005

thats why I told you it was just a quick fix... I usually do not use float tags... But I still pointed out that you have contained a floating element inside your container thats why you had that problem...

I guess I was thinking youll be using different page lengths and want complete control of it... Yes defenitely an overflow:auto; would work in this case...

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.