无序列表元素不会定位

时间:2015-07-11 01:57:23

标签: html css

我最近使用jQuery构建了一个滑出菜单,但包含菜单项的列表表现得很奇怪。无论我如何更改CSS,各种列表元素始终保持在相同的位置,彼此重叠。有问题的页面是this.

.slide-menu {
width: 30%;
left: -30%;
position: absolute;
z-index: 1;
background-color: white;
}

.dlink {
   font-size: 16px;
   position: absolute;
   width: 30%;
   display: block;
}

#slide-list{
    list-style: none;
    top: 0%;
    margin-left: 0px;
}

.sli-list-item {
    width: 30%;
}

#slide-panel {
    height: 100%;
    top: 0%;
}

这是相关的CSS。

1 个答案:

答案 0 :(得分:2)

将您的.dlink课程更改为:

.dlink {
  font-size: 16px;
  position: relative;
  width: 30%;
  display: block;
}

position: absolute;让他们排成一行。

相关问题