css实现悬浮卡片图文收藏效果代码

代码语言:html

所属分类:悬停

代码描述:css实现悬浮卡片图文收藏效果代码

代码标签: 卡片 图文 收藏 效果

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

<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title> Card</title>
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/reset.min.css">
<style>
    @import url("https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700;800;900&display=swap");
*, *:after, *:before {
  box-sizing: border-box;
}

body {
  font-family: "Lexend", sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #393232;
}

img {
  max-width: 100%;
  display: block;
}

.card-list {
  width: 90%;
  max-width: 400px;
}

.card {
  background-color: #FFF;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 20px 50px 0 rgba(0, 0, 0, 0.1);
  border-radius: 15px;
  overflow: hidden;
  padding: 1.25rem;
  position: relative;
  transition: 0.15s ease-in;
}
.card:hover, .card:focus-within {
  box-shadow: 0 0 0 2px #16C79A, 0 10px 60px 0 rgba(0, 0, 0, 0.1);
  transform: translatey(-5px);
}

.card-image {
  border-radius: 10px;
  overflow: hidden;
}

.card-header {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header a {
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.25;
  padding-right: 1rem;
  text-decoration: none;
  color: inherit;
}
.card-header a:after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
}

.icon-button {
  border: 0;
  background-color: #fff;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  font-size: 1.25rem;
  transition: 0.25s ease;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 3px 8px 0 rgba(0, 0, 0, 0.15);
  z-index: 1;
  cursor: pointer;
  color: #565656;
}
.icon-button svg {
  width: 1em;
  height: 1em;
}
.icon-button:hover, .icon-button:focus {
  background-color: #EC4646;
  color: #FFF;
}

.card-footer {
  margin-top: 1.25rem;
  border-top: 1px solid #ddd;
  padding-top: 1.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.card-meta {
  display: flex;
  align-items: center;
  color: #787878;
}
.card-meta:first-child:after {
  display: block;
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: currentcolor;
  margin-left: 0.75rem;
  margin-right: 0.75rem;
}
.card-meta svg {
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  margin-right: 0..........完整代码请登录后点击上方下载按钮下载查看

网友评论0