div+css布局文章卡片列表悬浮动画效果代码

代码语言:html

所属分类:布局界面

代码描述:div+css布局文章卡片列表悬浮动画效果代码,鼠标放上去试试。

代码标签: div css 布局 文章 卡片 列表 悬浮 动画

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

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
<style>
    @import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;700;800&display=swap");
html {
  font-size: 100%;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  -ms-overflow-style: scrollbar;
  height: 100%;
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  -webkit-box-sizing: inherit;
  box-sizing: inherit;
}

body {
  background: #22223a;
  font-family: "Inter", sans-serif;
  font-weight: 400;
  line-height: 1.65;
  color: #ffffff;
  margin: 0;
  height: 100%;
}

a {
  text-decoration: none;
}

.container {
  max-width: 1170px;
  width: 100%;
  margin: 0 auto;
  padding-right: 15px;
  padding-left: 15px;
  margin-top: 40px;
}

.row {
  display: flex;
  justify-content: space-between;
}

.col {
  width: 32%;
}

@media (max-width: 576px) {
  .row {
    display: block;
  }
  .row .col {
    width: 100%;
    margin: 0 0 10px 0;
  }
}
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 1.5rem 0 1.5rem;
  font-weight: 700;
  line-height: 1.5;
  font-family: "Inter", sans-serif;
  color: #ffffff;
}

.card {
  background: #2f2d44;
  margin-top: 1.5rem;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease-in-out;
}
.card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.card:focus {
  -webkit-box-shadow: 0 0 0 3px #22223a, 0 0 0 4px #38beea;
  box-shadow: 0 0 0 3px #22223a, 0 0 0 5px #38beea;
  outline: none;
  border-radius: 2px;
  z-index: 1090;
  position: relative;
}
.card h2 {
  font-size: 1.25rem;
  margin: 0;
}
.card .card-content {
  padding: 2rem;
  min-height: 110px;
  padding-bottom: 1rem;
}
.card .card-content .kicker {
  color: #38beea;
  margin-top: 0;
  text-transform: uppercase;
  letter-spacing: 0.16rem;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.card .card-content p {
  color: #adacb5;
}
.card .card-content p:last-of-type {
  margin-bottom: 0;
}
.card .card-image img {
  width: 100%;
  height: auto;
}
.card .card-footer {
  position: relative;
}
.card .card-footer .icon {
  position: absolute;
  right: 2rem;
  max-width: 20px;
  top: 50%;
  margin-top: -10px;
  transition: color 0.3s;
}
.card .card-footer a {
  background: transparent;
  border: none;
  color: #fff;
  padding: 1.25rem 2rem;
  width: 100%;
  text-align: left;
  display: block;
  opacity: 0;
  position: relative;
  top: 3px;
  font-weight: 400;
  transition: opacity 0.3s, top 0.3s ease 0s;
}
.card .card-footer a:hover, .card .card-footer a:focus {
  text-decoration: none;
  opacity: 1;
  top: 0;
}
.card .card-footer a:focus {
  box-shadow: inset 0 0 0 2px #38beea;
  outline: none;
  border-radius: 2px;
  z-index: 1090;
  position: relative;
}
.card .card-footer:after {
  content: "";
  width: 0%;
  height: 3px;
  background: #38beea;
  position: absolute;
  bottom: 0;
  left: 0;
  transition: width 0.3s;
}
.card .card-footer:hover:after {
  width: 100%;
}
.card:hover .card-footer .icon, .card:focus .card-footer .icon {
  color: #38beea;
}
.card:hover .card-footer a, .card:focus .card-footer a {
  opacity: 1;
  top: 0;
}
.card:hover .card-footer:after, .card:focus .card-footer:after {
  width: 100%;
}
</style>

</head>
<body>
<!-- partial:index.partial.html -->
<div class="container">
      <div class="row">
        <div class="col">
          <div class="card" tabindex="0">
            <div class="card-image">
              <img src="//repo.bfw.wiki/bfwrepo/image/5e59c09d79a9c.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_400,h_300,/quality,q_90" alt="">
            </div>
            <div class="card-content">
              <p class="kicker">Technology</p>
              <h2>Using Bann.........完整代码请登录后点击上方下载按钮下载查看

网友评论0