-1

我正在寻找 html 屏幕的解决方案。它包含两个块,下面的一个与上面的一个重叠。

我知道如何制作圆角,但不知道如何重叠两个 div。

重叠组件

提前致谢!

4

1 回答 1

1

方法之一:

.container {
  display: grid;
  justify-content: center;
}

.content {
  border-radius: 10px;
  position: relative;
  z-index: 2;
  top: -20px;
  text-align: center;
  height: 150px;
  background-color: whitesmoke;
  padding: 1em;
}
<div class="container">
  <image src="https://picsum.photos/200" />
  <div class="content">text</div>
</div>

于 2021-08-26T08:31:21.103 回答