Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Background in IE not working.

Status
Not open for further replies.

alan28

Technical User
Jul 31, 2002
60
0
0
GB
I have set the background in my css file as so
body {
background-image: url(background.gif);
}

It shows up in firefox but not in ie 6. What is happening?
 
Try
Code:
body	{
	background-image:url('background.gif');
}

Thats the format I use on my sites. If that doesn't work, something else might be messing with your bg.
 
You don't need to use quotes.

It is either:

1. The path specified to the image is incorrect. The path should be relative to the file in which the CSS resides.

2. You can't see the background as the element has no height. Are there any elements inside this element? Are they floated? Floated elements will not effect the height of the element their containing element.

<honk>*:O)</honk>
Foamcow Heavy Industries - Web site design in Cheltenham and Gloucester
Ham and Jam - British & Commonwealth forces mod for Half Life 2
 
i would also want to know what else you have in your style sheet. i find it hard to believe there's only one single style entry for one single element. css errors cause other css definitions to work improperly.



*cLFlaVA
----------------------------
[tt]somebody set up us the bomb![bomb][/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
If the background.gif is a larger file, then try to clear IE's cache. I've had some funky problems due to caching of images...

Regards


Jakob
 
You can use this as:
<STYLE type="text/css">
<!--
BODY { background-image:url(image1.gif);}
-->
</STYLE>

or,
<STYLE type="text/css">
<!--
BODY { background-image:url( -->
</STYLE>

depending on the image location path. This works perfectly on FF and IE. If you are getting the same output, do post the complete CSS. Any other contents in that CSS might be preventing the backgroud image.

Prashant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top