Internet Explorer doesn't recognize css html background image tag?

Mostly I was wondering if there was any work on this? I redesigned my old plumbing website and took some ideas from this site http://visitmix.com/ , where they used the body css body tag as the background header with several overlapping designs in the main body of the site - and the html css tag for the background, repeating the image of the rest of the web page. Although this works in firefox and chrome, the background of Internet Explorer is only the background color.

The website I'm working on is here: http://www.plumberkendal.co.uk , which shows what I mean. I tried a lot of things with the width and height of the html css tag, but to no avail .. heres css in question:

html 
{
 background-image: url("../images/html_bg.png");
 background-repeat: repeat;
 background-color: #5a84c5;
 height: auto;
 width: auto; 
}

body 
{
 padding-top: 0px;
 margin-top: 0px;
 margin-right: 0px;
 margin-left: 0px;
 margin-bottom: 0px;
 padding-bottom: 0px;
 background-image: url("../images/header_bg.png");
 background-repeat: no-repeat;
 background-position: center top;
 text-align: center;
 }

Any help would be greatly appreciated, cross-browser compatibility with css is an area that really confuses me!

+1
source share
2 answers

You should assign the background to the body selector, not the HTML tag:

body 
{
background-image: url("../images/html_bg.png");
 padding-top: 0px;
 margin-top: 0px;
...
}

The purpose of this HTML selector will not work, because HTML contains a head element, as well as a body, and is usually not considered an object with a background.

<html> <head> , .

( - , !):)

+4

, , , - . , <htm>. , DOCTYPE. :

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

@charset "utf-8"; .

background , , , .

    html {
           background: url("../images/html_bg.jpg") #000 repeat-x;
    }

<body>, <html>, Firefox IE.

0

All Articles