css background-image not working properly

狂风中的少年 提交于 2019-12-06 10:25:29

Your code is perfect. I tested it on jsFiddle. The problem is with your image URL

Check this out: jsFiddle link

body
{
    background: url("http://jsfiddle.net/img/logo.png") repeat left top;    
    font: normal 10pt Arial,Helvetica,sans-serif;

}

Here, i only change the image url.

I would have commented to @MohitPandey but I need 50 reputation, therefore I'll add it here. When you are providing direct URL's it is always better to remove the 'http' or else there will be security warnings when you are displaying content on a secure page. So modify it as follows.

body
{
    background: url("//jsfiddle.net/img/logo.png") repeat left top;    
    font: normal 10pt Arial,Helvetica,sans-serif;
}

I learnt this from HTML5Boilerplate. Hope it helps!

The error is in your body STYLING...

.Body
{
  background-image: url('pagebg2.jpg');
  background-repeat: repeat;
  background-position: left top;
  font-family: Arial;
  font-size: 10pt;
}

Try the above...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!