在整个网页上覆盖图像
问题描述:
是否可以在整个网页上覆盖重复的图像?如果是,怎么办?
Is it possible to overlay a repeating image over a entire web page? If so, How?
答
类似这样的东西:
HTML
<div class="overlay"></div>
CSS
.overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: url("image.png") repeat;
}
您可能希望将div放在html的最后,以确保它位于页面上所有其他内容之上,或者您可以使用z-indexing。
You probably want to put the div at the very end of the html to ensure it's above everything else on the page, alternatively you could use z-indexing.