如何让我的背景工作

时间:2009-08-11 14:20:41

标签: css

我有一个网站,背景需要在我的身体css(得到条纹的图像)我的身体css我把它设置为背景图像并重复它,到目前为止很好:

    body
{
    font-family: Verdana, Sans-Serif;
    text-align: left;
    margin:0px;
    text-align:center;
    background-image:url(../Gfx/Design/bg.png);
    background-repeat:repeat;
    width:100%;
    height:100%;
}

#BGContainer
{
    margin:0px;
    background-image:url(../Gfx/Design/background.png);
    background-repeat:repeat-x;
    width:100%;
    height:100%;
    z-index:101;
}

这是我的HTML

<body>
    <form id="form1" runat="server">
    <div id="BgContainer">
        </div>
    </form>
</body>

然后我有另一个图像,顶部有一个渐变,其中这些颜色渐渐消失。此图片应覆盖背景的顶部。这是我在我的代码中尝试做的,但它不起作用。它只显示位于我的body元素内的bg.png的平铺。我从未见过叠加层。任何人吗?

/干杯

3 个答案:

答案 0 :(得分:4)

CSS(假设至少)区分大小写 - 您在CSS中有#BGContainer但在HTML中有BgContainer

答案 1 :(得分:2)

尝试在#BGContainer div中添加内容,例如&nbsp;

答案 2 :(得分:0)

您不能只将渐变叠加层包含在条纹图像中吗?

或者我误解了你的问题?