Internet Explorer doesn't recognise the 'html' css background image tag?

后端 未结 2 1385
感情败类
感情败类 2020-12-22 01:44

I was basically wondering if there was a work around to this? I was redesigning my old mans plumbing website, and took a few of the ideas from this website http://visitmix.c

2条回答
  •  天涯浪人
    2020-12-22 01:57

    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;
    ...
    }
    

    Assigning it to the HTML selector will not work as the HTML contains the head element as well as the body, and is not generally treated as an object that has a background.

    Assigning it to the body selector will ignore the and tags and put it right onto the main body of your page, displaying the background as intended.

    (If anyone else can explain this better, go ahead!) :)

提交回复
热议问题