小编Zi *_*ang的帖子

z-index 不能以绝对方式工作

在此输入图像描述

我希望新来者的孩子始终位于顶部(z-索引:9999),但我无法使其工作。我对绝对类和相对类感到困惑...我已经尝试了几个小时,仍然无法使其工作...需要帮助。

/* parent menu */

ul.menu {
  list-style: none;
  padding: 0;
  margin: 0;
  /*background: #34495e;*/
  margin: 50px auto;
  width: 800px;
  width: -moz-fit-content;
  width: -webkit-fit-content;
  width: fit-content;
  z-index: 10;
  position: relative;
}
ul.menu li {
  display: block;
  float: left;
  background: #34495e;
  transform: skewX(25deg);
}
.menu > li > a {
  transform: skewX(-25deg);
  padding: 1em 2em;
}
.menu a {
  display: block;
  color: #fff;
  text-transform: uppercase;
  text-decoration: none;
  font-family: Arial, Helvetica;
  font-size: 14px;
}
ul.submenu.level_2 {
  position: absolute;
  width: auto;
  left: 0%; …
Run Code Online (Sandbox Code Playgroud)

html css

1
推荐指数
1
解决办法
1万
查看次数

标签 统计

css ×1

html ×1