Stacking DIVs on top of each other?

前端 未结 9 2296
暗喜
暗喜 2020-12-02 07:59

Is it possible to stack up multiple DIVs like:

&l
9条回答
  •  情话喂你
    2020-12-02 08:27

    You can now use CSS Grid to fix this.

    And the css for this:

    .outer {
      display: grid;
      grid-template: 1fr / 1fr;
      place-items: center;
    }
    .outer > * {
      grid-column: 1 / 1;
      grid-row: 1 / 1;
    }
    .outer .below {
      z-index: 2;
    }
    .outer .top {
      z-index: 1;
    }
    

提交回复
热议问题