Jump to content

[SOLVED] Backgrond image problem


coldkill

Recommended Posts

Hey folks,

I've got a problem with IE7 in that it pushes the background image of my main content to the right by about 5 pixels. This makes the divider at the bottom of the content area look displaced. Anyone know how to solve this? It only happens in IE (go figure ¬¬) but it's not going to be a problem to have IE run off a seperate style sheet.

 

Thanks,

Cold

 

Note: The style for this isn't done yet hence the warning stripes and crappy looking nav bar.

 

bug.png

Link to comment
Share on other sites

Just a suggestion since I don't use IE 7. However, in my experience (I ususally play with the style sheet code), is to add margin:0 and padding: 0 in the CSS for the main content section. It is likely a margin/padding issue that Firefox would not set where IE does. For this, you shouldn't need another stylesheet.

 

Link to comment
Share on other sites

what doc type are you using?  is there a borer on this panel? FF and IE still differ in how they render background images when an element has a border; once places teh background behind or under the border the other doesn't start rendering until the border is drawn...

Link to comment
Share on other sites

CSS:

#content
{
width:770px;
background-image:url(images/backgrounds/conbg.png);
background-repeat:repeat-y;
text-align:left;
font-size:11px;
padding-top: 2px;
padding-right: 0px;
padding-bottom: 0px;
padding-left: 70px;
margin-left: 130px;
margin-right: 0px;
vertical-align:top;

}

 

HTML:

<!-- Start Content Area -->
<div id="content">
	<div id="contentlimit">
		'.$content.'
	</div>
<br />
</div>
<!-- End Content Area -->

 

The variable $content is replaced with the actual page code.

 

Cold

Link to comment
Share on other sites

I downloaded your site onto my machine and played around with it locally.  The only way I could fix the issue was when I removed the navigation to the left.  You might consider restructuring that navigation, maybe use something other than a table.

Link to comment
Share on other sites

Okay, I got it to work in IE6, but when it does it breaks in Firefox.  To get it to work in both browsers you will need to use an IF IE6 statement in your header.  What I describe below is what you need to put in your IF IE6 style sheet.  I don't have IE7 on my desktop, thank you MS Validation check, so you will need to test this on your own in IE7.

 

First:  I changed the width:130px; to width: 100%; in .mhead and .mlink a

Second:  I changed the width:130px; of #nav to width:127px;

Third:  I adjust the margin-left: 130px; of #content and #condiv to margin-left: 127px;

 

The last one is a bit more tricky, and makes me cringe at the whole thing...  You need to be able to adjust menudiv.jpg's width based on which browser is viewing it.  Firefox needs the 130px version, IE needs the 127px version.  To pull this off you will need to make the img a background of a div, this will let you define the background image separately in each style sheet.

 

Like I said, this is how I got it to work.  I really think there is a larger overall issue that is causing this problem...but as of right now I don't see it or don't know it.

Link to comment
Share on other sites

Ok so it worked with my old style sheet and images. This one doesn't seem to work though. The only things I have changed are the colours and the images themselves. Yet Firefox still displays the site as it is designed to be shown.

 

Any ideas?

Cold

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.