无序列表上的插入框阴影不起作用

时间:2013-06-28 16:32:18

标签: css

我正在尝试在无序列表上设置插入框阴影,但它似乎没有显示。我列出了下面的代码和结果的屏幕截图。

非常感谢任何帮助!

ul {
    width: 100%;
    list-style: none;
    text-align: center;
    margin: 0;
    padding: 0;
    position: relative;
}

ul:before {
    border-radius: 5px;
    box-shadow: 0 0 0 1px #b7b7b7, 0 0 0 2px #fff, inset 0 0 15px #000;
    position: absolute;
    height: 100%;
    width: 100%;
    content:'';
    left: 0;
    top: 0;
}

li {
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    padding: 19px 1em;
    width: 100%;
    background-color: #fefefe;
    border-bottom: 1px solid #e1e1e1;
    text-align: left;
    position: relative;
}

enter image description here

1 个答案:

答案 0 :(得分:1)

发现它!

列表项的定位不应设置为相对。感谢雅各布指出它可能是掩盖它的列表项目! :)

相关问题