Background-image inside div not showing up

有些话、适合烂在心里 提交于 2019-11-29 12:45:08

#topImage doesn't have a height set, and no elements inside it which would give it a height.

#topImage
{
  position:absolute;
  background-image:url("images/Top-Banner.gif");
  background-repeat:repeat-x;
  width:100%;
  height: 100px; /* Change to the height you need */
  top:0px;
  left:0px;
}

Or just stick an img tag inside the div instead of using background-image, that would work as well.

try using the following syntax

#topImage
{
  position:absolute;
  background-image:url("../images/Top-Banner.gif");
  background-repeat:repeat-x;
  width:100%;
  height: 100px; /* Change it to auto if you need to div to adjust automatically according to contents inside it */
  top:0px;
  left:0px;
}

hope that sorts out the problem

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