如何在CSS / HTML中将背景渐变图像叠加在另一个无限背景图像的顶部

时间:2012-01-05 15:48:34

标签: html overlay background-image css

因此,我试图发现如何在无限重复的方格方块顶部重叠或延伸整个屏幕底部的渐变。我可以在桌子周围出现一个渐变,我已经为该页面编写过,但它不会扩展到整个页面。

我在下面写的内容就是我对这个项目的看法。我有点新代码,所以我很感激你们给我的任何帮助。

<style type="text/css">

BODY{`background-image: url(image); repeat;}
div.wrapper {
background-image: url(image2.gradient); repeat-x fixed;
</style>

<div class="wrapper">
<table>

然后它继续......

1 个答案:

答案 0 :(得分:0)

您的wrapper div只会与其内容一样大,因此您需要在wrapper课程中将高度和宽度设置为100%。

div.wrapper {
  position: relative;      
  background: url(image2.gradient) repeat-x fixed;
  width: 100%;
  height: 100%;
}
相关问题