Link to home
Start Free TrialLog in
Avatar of snobrdrt
snobrdrtFlag for Afghanistan

asked on

IE7 CSS Background Image Not Showing

I'm having a problem with a background image not showing in IE7. I saw a few other solutions where they say to use position: relative. When I do this it BREAKS my header. The current code is position: absolute. It works fine in all relevant browsers EXCEPT IE7.

Here is the CSS:

.logo {
      height:149px;
      width:671px;
      background-image:url(../images/logo.jpg);
      background-color: #ffffff;
      padding:0px;
      margin: 0px;
      position:absolute;
}

Here is the HTML:

<div class="logo"></div>

Any help would be appreciated!

Thanks,

Tony
Avatar of Dushyant Sharma
Dushyant Sharma
Flag of India image

try adding left and top property as 0
Avatar of snobrdrt

ASKER

This moved my logo far left. the problem I have is with SEEING the logo in IE7, not positioning.
Avatar of Chad Haney
can you provide some more context?  Do you have a link we can use to see the problem or can you attach the code?
Sure can ... here's the link to the development server: http://63.135.115.128/
Hmm nice IE8 running IE7 mode can see it, but IE7 can't.   Try changing the path of the image to  background-image:url(/images/logo.jpg); since there isnt any directory higher than the root.
On a separate note, you may want to change the center_curve arrows to link to something like javascript:return false; or javascript:void 0;.  Right now if you click them to the end they let you hit # which jumps you to the top of the page if you were scrolled down and clicking the arrows.
Still not working .... my IE8 running in IE7 mode doesn't see at all. It's strange because the top background shows up no problem!
looks like IE is reading the css wrong.  might have something to do with background-repeat:none; since this is invalid.  It should be background-repeat:no-repeat;

Below is some valid css you could modify to:
.logo {
	height:149px;
	width:671px;
	background:#ffffff url(../images/logo.jpg) no-repeat top left;
	padding:0px;
	margin: 0px;
	position: absolute;
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Chad Haney
Chad Haney
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Al of the things you gave me did not work. Not your fault. the absolute positioning was just not working in IE7 no matter what. So what I did was rebuilt the CSS altogether.

What I came up with is below:

.logo {
      padding-bottom: 0px;
      padding-left: 0px;
      padding-right: 0px;
      float: left;
      padding-top: 0px;
      height: 149px;
}

As far as the JS on the arrows go, can you suggest how to do this? I'm a JS novice. The file which controls this is 2-jcarousellite_1.0.1.js.

At the bottom of this file it looks like after the string of photos finish, it's supposed to disable the next arrow. Actually on both the beginning "previous" button and the "next" button at the end.
The solutions given did not fix the problem unfortunately. I had to rebuild the CSS altogether to get it to work. Good effort though. Thanks.