css实现盒子悬浮上拉展示详细内容-案例

效果图-在线体验

 样式代码

.wrap_div1 {
  position: relative;
  width: 260px;
  height: 430px;
  overflow: hidden;
  border: 1px solid red;
}
.boxCSS {
  width: 100%;
  height: 100%;
  text-align: center;
  border-radius: 10px;
  display: block;
  cursor: pointer;
}
.mask1 {
  position: absolute;
  /* top: 0; */
  right: 0;
  left: 0;
  bottom: -82%;
  width: 100%;
  height: 100%;
  /* opacity: 0; */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: rgba(46, 81, 111, 0.8);
  padding: 16px 0;
  box-sizing: border-box;
  transition: all 1s;
}
.wrap_div1:hover .mask1 {
  background: rgba(86, 32, 112, 0.8);
  padding: 30px 0;
  bottom: 0;
  /* opacity: 1; */
}
<div class="wrap_div1">
  <div class="boxCSS">
    背景内容
  </div>
  <div class="mask1">
    <h3>提示内容</h3>
  </div>
</div>

posted @ 2021-08-11 16:32  JackieDYH  阅读(8)  评论(0编辑  收藏  举报  来源