Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 背景中的图像<;ul>;列表,css_Html_Css - Fatal编程技术网

Html 背景中的图像<;ul>;列表,css

Html 背景中的图像<;ul>;列表,css,html,css,Html,Css,这是我的密码: #jackpots { position: relative; width: 228px; min-height: 30px; background: url(images/pattern.png) repeat; } .bottomImage { position: absolute; bottom: 0; z-index: 1; } #jackpots ul { z-

这是我的密码:

    #jackpots {
    position: relative;
    width: 228px;
    min-height: 30px;
    background: url(images/pattern.png) repeat;
    }

    .bottomImage {
    position: absolute;
    bottom: 0; 
    z-index: 1;
    }

    #jackpots ul {
    z-index: 2;
    }
HTML:


您需要更改CSS:

#jackpots ul {
    position: relative;
    z-index: 2;
}

position
值更改为
relative
将允许
z-index
影响堆叠顺序,这正是您想要的。

删除z-index并重试?为什么将其设置为2?希望
    位于图像顶部。删除z索引似乎不起作用欢迎使用SO!记住接受答案并获得2点声誉积分。感谢您花时间发布您的HTML/CSS。
    #jackpots ul {
        position: relative;
        z-index: 2;
    }