css实现鼠标悬浮卡片图片分割更换文字效果代码

代码语言:html

所属分类:悬停

代码描述:css实现鼠标悬浮卡片图片分割更换文字效果代码

代码标签: 悬浮 卡片 图片 分割 更换 文字 效果

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


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

<head>

  <meta charset="UTF-8">
  

  
  
  
<style>
@import url("https://fonts.googleapis.com/css?family=Poppins");
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
  background: #141E30;
  background: -webkit-linear-gradient(to top, #243B55, #141E30);
  background: linear-gradient(to top, #243B55, #141E30);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Poppins", sans-serif;
  overflow: hidden;
}

.card {
  border-radius: 16px;
  width: 360px;
  height: 360px;
  background: url(//repo.bfw.wiki/bfwrepo/image/5d65ea7d8bc8b.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_360,h_360,/quality,q_90);
  position: relative;
  overflow: hidden;
  box-shadow: 0 5px 50px rgba(0, 0, 0, 0.85);
}
.card:before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  background-color: rgba(0, 0, 0, 0.92);
}
.card .img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
}
.card .img span {
  width: 25%;
  height: 100%;
  background: url(//repo.bfw.wiki/bfwrepo/image/5d65ea7d8bc8b.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_360,h_360,/quality,q_90);
  transition: 0.5s;
}
.card .img span:nth-child(1) {
  background-position: 0;
 .........完整代码请登录后点击上方下载按钮下载查看

网友评论0