css实现卡片悬浮图片背景虚化文字放大效果代码

代码语言:html

所属分类:悬停

代码描述:css实现卡片悬浮图片背景虚化文字放大效果代码

代码标签: 悬浮 图片 背景 虚化 文字 放大 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">

  
  
  
  
<style>
body {
  background-color: #007f5f;
}
body .base {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
}
@media screen and (max-width: 500px) {
  body .base {
    flex-direction: column;
  }
}
body .base .picture {
  --border-color: #ffff3f;
  border-radius: 10px;
  border: 10px solid;
  border-color: var(--border-color);
  width: 30%;
  height: 50vh;
  position: relative;
  overflow: hidden;
  transition: all 900ms cubic-bezier(0.075, 0.82, 0.165, 1);
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
body .base .picture .name {
  --name-size: 5vw;
  color: #ffff3f;
  position: absolute;
  bottom: 0;
  left: 0.5rem;
  font-family: "Kaushan Script", cursive;
  margin: 0;
  z-index: 9;
  font-size: var(--name-size);
  text-shadow: 2px 2px 4px #000000;
  transition: font-size 300ms ease-in-out;
}
body .base .picture .pictureimg {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  filter: grayscale(100%);
  transition: transform 9000ms cubic-bezier(0.075, 0.82, 0.165, 1), filter 900ms cubic-bezier(0.075, 0.82, 0.165, 1);
}
body .base .picture:nth-child(1) .pictureimg {
  background-image: url("//repo.bfw.wiki/bfwrepo/image/6049b50ce9250.png");
}
body .base .picture:nth-child(1):focus, body .base .picture:.........完整代码请登录后点击上方下载按钮下载查看

网友评论0