I need to add a doctype to my html webpage because IE will only format it correctly if I do so. But when I add it, some images on the page are not loading. The images are embedded with the CSS background property and displayed to the screen in divs. It doesn’t load the images in all common browsers.
What could be the problem? I really do need the doctype up.
CSS:
.blue {
position: absolute;
background: url(blue.png) no-repeat center center;
top: 163;
width: 228;
height: 434;
}
.green {
position: absolute;
background: url(green.png) no-repeat center center;
top: 120;
width: 266;
height: 209;
}
.orange {
position: absolute;
background: url(orange.png) no-repeat center center;
top: 183;
width: 165;
height: 291;
}
HTML:
<div class="blue"> </div>
<div class="green"> </div>
<div class="orange"> </div>
Doctype at the top:
<!DOCTYPE html>
I think it has to do with your CSS width and height declarations not having ‘px’ at the end of it.
Can you check if the
<div>elements render with a width and height in order to display the background image?