可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
So I was working on this site and I had the displaying how I was wanting. After working on a lower page banner all of a sudden everything disappeared and all I was left with was the background Image in the Body.
Can you figure out why the topImage id does not display? It is frustrating as hell to see it work one second and then not the other:
Sorry if this a really basic question, I am kind of new at this.
回答1:
#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.
回答2:
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