小编pan*_*ing的帖子

父元素背景过滤器不适用于其子元素

请参考以下片段。我想知道如何使背景过滤器适用于下拉菜单ul

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: hsla(0, 0%, 100%, 80%);
  border-bottom: 1px solid hsla(0, 0%, 0%, 10%);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 1;
}

nav ul {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav li {
  position: relative;
  margin: 0 20px;
  height: 50px;
  line-height: 50px;
}

nav li ul {
  position: absolute;
  top: 50px;
  left: 0;
  flex-direction: column;
  align-items: stretch;
  width: 200px;
  background: hsla(0, 0%, …
Run Code Online (Sandbox Code Playgroud)

css css-filters

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

标签 统计

css ×1

css-filters ×1