html and css blog 和post 产品文章推荐展示卡cid1096-网页前端设计

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title></title>
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <div class="blog-posts">
    <div class="post">
      <img src="1.jpg" alt="" class="post-img">
      <div class="post-content">
        <h3>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quis, soluta?</h3>
        <span class="date">July 13, 2020</span>
      </div>
    </div>

    <div class="post">
      <img src="2.jpg" alt="" class="post-img">
      <div class="post-content">
        <h3>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quis, soluta?</h3>
        <span class="date">July 13, 2020</span>
      </div>
    </div>

    <div class="post">
      <img src="3.jpg" alt="" class="post-img">
      <div class="post-content">
        <h3>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quis, soluta?</h3>
        <span class="date">July 13, 2020</span>
      </div>
    </div>
  </div>
</body>
</html>

 

*{
  margin: 0;
  padding: 0;
  font-family: "Open Sans",sans-serif;
}

body{
  background-color: #444;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-posts{
  width: min(1200px, 100%);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  cursor: pointer;
}

.post{
  width: calc(33% - 10px);
  overflow: hidden;
}

.post-img{
  width: 100%;
  border-radius: 6px;
  transition: .3s linear;
}

.post-content{
  background-color: #ffffffdd;
  margin: 0 20px;
  padding: 30px;
  border-radius: 6px;
  transform: translateY(-60px);
  transition: .3s linear;
}

.post-content h3{
  font-size: 16px;
  margin-bottom: 10px;
}

.date{
  font-size: 15px;
  font-style: italic;
  color: #e77f67;
}

.post:hover .post-img{
  transform: translateY(20px);
}

.post:hover .post-content{
  transform: translateY(-80px);
}

@media screen and (max-width: 1200px){
  .blog-posts{
    justify-content: center;
  }
  .post{
    width: min(600px, 100%);
  }
}

 

在线演示


让链接同时具备两种打开方式
获取源码: Blog Posts
下载数:87人次, 文件大小: 426.6 KB, 上传日期: 2020年-11月-25日

公众号回复:gcode  获取解压密码

qrcode_for_gh_6ea2c28a1709_258 (1)

2,534 人查阅

一键获取本网站前端代码设计的所有源码

获取资源构建和完善自己的源码库
源码可以在本地直接演示
同时研究和体验 如何将一些具体的想法的实现过程
源码可以直接嫁接到自己的网站里复用
稍作修改成为自己的作品
下载 (4)

您需要先支付 6元 才能查看此处内容!立即支付

类似文章