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;
}