I am having an issue with my background image not loading on IE7. The background doesn't load at all. It works fine with FF, Chrome, and IE8 though.
I am having an issue with my background image not loading on IE7. The background doesn't load at all. It works fine with FF, Chrome, and IE8 though.
A few precise checks and fixes that commonly resolve a background image that shows in modern browsers but not in IE7.
The validator hint noted by and the observation from about mixing markup and styling point to the root causes: invalid HTML or styling applied to the wrong element. Backgrounds must be set with CSS on an element that actually has dimensions (and in IE7 some layout quirks must be handled). Moving the image into CSS instead of relying on an <img> for a page background is the simplest, most robust fix.
A minimal CSS pattern that works across older IE versions:
html, body {
height: 100%;
margin: 0;
}
#page {
background: url('/path/to/background.jpg') center top no-repeat;
/* if the layout needs it, give the element explicit dimensions or positioning */
} IE7-specific notes and quick fixes: give parent elements an explicit height when using percentage heights; trigger hasLayout for a problematic element with zoom: 1; if background painting seems inconsistent; avoid relying on background-size (not supported in IE7) — use a centered no-repeat background or a JS/CSS polyfill for cover behavior. Be careful with negative z-index on background elements; placing the background on the body/html is usually safer than pushing an element behind the content with negative z-index.
Checklist for debugging: validate HTML/DOCTYPE to force standards mode, test a simple page with only a body background rule to isolate the problem, verify the image is actually requested by IE7 (network trace), and if needed add an IE7-only rule via conditional comments to work around quirks. was correct that browsers differ — addressing markup validity and IE7 layout quirks will usually fix it.
Jump to Post— JameB 66http://validator.w3.org/check?uri=http://lostangelsproject.com/&charset=(detect+automatically)&doctype=Inline&group=0
On Line 409:
<div id="background"><img src="" alt="field" style="width: 100%; height: 100%; background-repeat: no-repeat"/></div>
What is no-repeat by itself? It makes no sense!
http://validator.w3.org/check?uri=http://lostangelsproject.com/&charset=(detect+automatically)&doctype=Inline&group=0
On Line 409:
<div id="background"><img src="" alt="field" style="width: 100%; height: 100%; background-repeat: no-repeat"/></div>
What is no-repeat by itself? It makes no sense!
http://validator.w3.org/check?uri=http://lostangelsproject.com/&charset=(detect+automatically)&doctype=Inline&group=0
On Line 409:
<div id="background"><img src="" alt="field" style="width: 100%; height: 100%; background-repeat: no-repeat"/></div>
What is no-repeat by itself? It makes no sense!
Actually it indicates "style="width: 100%; height: 100%; background-repeat: no-repeat""... looks like they're trying to combine css style formatting with html style formatting which is fine for most browsers but not necessarily all.
From what it's showing there the intent was a single image set to 100% width and height of the page with no repeat.
every browser have different property to show and load the web pages. we can make all browser friendly website design.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.