Background image doesn't show for header

自古美人都是妖i 提交于 2019-12-02 13:44:34

Try setting a width and height on your header element's css.

.logoBar {
   width: 100%;
   height: 250px; <!-- Your image height goes here...
   background:url('http://img704.imageshack.us/img704/2162/67726065.jpg') repeat-x center top;
}

You have to set a width and height for the header. If it has no content it will simply be 0px wide and 0px tall.

.logoBar {
   background:url('http://img704.imageshack.us/img704/2162/67726065.jpg') repeat-x center top;
   width: 900px;
   height: 300px;
}

Demo: http://jsfiddle.net/Zjczp/

now define value of your class .logobar

as like this

.logobar{display:block;}

and define width and height according to @WDffy and @Cristy

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