css实现响应式社交微博朋友圈动态效果代码

代码语言:html

所属分类:响应式

代码描述:css实现响应式社交微博朋友圈动态效果代码

代码标签: cs 响应式 社交 微博 朋友圈 动态

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

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

<head>
  <meta charset="UTF-8">
  

  
  
  <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.6.5.1.css">
  
<style>
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&family=Ms+Madi&family=Satisfy&display=swap");



* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*:focus {
  outline: none;
}

.logo {
  font-family: "Ms Madi", cursive;
  font-weight: 600;
  font-style: normal;
  font-size: 2rem;
}

body {
  width: 100%;
  background: #fafafa;
  position: relative;
  font-family: "roboto", sans-serif;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: #fff;
  border-bottom: 1px solid #dfdfdf;
  display: flex;
  justify-content: center;
  padding: 5px 0;
}

.nav-wrapper {
  width: 70%;
  max-width: 1000px;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-img {
  height: 100%;
  margin-top: 5px;
}

.search-box {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 25px;
  background: #fafafa;
  border: 1px solid #dfdfdf;
  border-radius: 2px;
  color: rgba(0, 0, 0, 0.5);
  text-align: center;
  text-transform: capitalize;
}

.search-box::placeholder {
  color: rgba(0, 0, 0, 0.5);
}

.nav-items {
  height: 22px;
  position: relative;
}

.icon {
  height: 100%;
  cursor: pointer;
  margin: 0 10px;
  display: inline-block;
}

.user-profile {
  width: 22px;
  border-radius: 50%;
  background-image: url(//repo.bfw.wiki/bfwrepo/image/5d653b5271e3b.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_100,h_100,/quality,q_90);
  background-size: cover;
}

.main {
  width: 100%;
  padding: 10px 0;
  display: flex;
  justify-content: center;
  margin-top: 50px;
}

.wrapper {
  width: 70%;
  max-width: 1000px;
  display: grid;
  grid-template-columns: 60% 40%;
  grid-gap: 20px;
}

.left-col {
  display: flex;
  flex-direction: column;
}

.status-wrapper {
  width: 100%;
  height: 120px;
  //background: #fff;
  //border: 1px solid #dfdfdf;
  border-radius: 2px;
  padding: 10px;
  padding-right: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  overflow-x: auto;
}

.status-wrapper::-webkit-scrollbar {
  display: none;
}

.status-card {
  flex: 0 0 auto;
  width: 80px;
  max-width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 15px;
  cursor: pointer;
}

.profile-pic {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
  padding: 3px;
  background: linear-gradient(45deg, rgb(255, 230, 0), rgb(255, 0, 128) 80%);
  cursor: pointer;
}

.profile-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #fff;
}

.username {
  width: 100%;
  overflow: hidden;
  text-align: center;
  font-size: 12px;
  margin-top: 5px;
  color: rgba(0, 0, 0, 0.5);
}

.post {
  width: 100%;
  height: auto;
  border: 1px solid #fafafa;
  margin-top: 10px;
  &:hover {
    background: #fff;
    border: 1px solid #dfdfdf;
  }
}

.info {
  width: 100%;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.info .username {
  width: auto;
  font-weight: bold;
  color: #000;
  font-size: 14px;
  margin-left: 10px;
}

.info .options {
  height: 10px;
  cursor: pointer;
}

.info .user {
  display: flex;
  align-items: center;
}

.info .profile-pic {
  height: 40px;
  width: 40px;
  padding: 0;
  background: none;
}

.info .profile-pic img {
  border: none;
}

.post-image {
  width: 100%;
  height: 500px;
  object-fit: cover;
}

.post-content {
  width: 100%;
  padding: 20px;
}

.likes {
  font-weight: bold;
  font-size: 0.75rem;
  margin-top: -10px;
}

.description {
  margin: 10px 0;
  font-size: 14px;
  line-height: 1rem;
  font-size: 0.75rem;
  margin-top: 5px;
}

.description span {
  font-weight: bold;
  margin-right: 10px;
}

.post-time {
  color: rgba(0, 0, 0, 0.5);
  font-size: 0.60rem;
  margin-top: -10px;
}

.comment-wrapper {
  width: 100%;
  height: 20px;
  border-radius: 1px solid #dfdfdf;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: -10px;
  margin-bottom: 10px;
}

.comment-wrapper .icon {
  height: 20px;
}

.comment-box {
  width: 80%;
  height: 100%;
  border: none;
  outline: none;
  font-size: 14px;
}

.comment-btn, .action-btn {
  width: 70px;
  height: 100%;
  background: none;
  border: none;
  outline: none;
  text-transform: capitalize;
  font-size: 16px;
  color: rgb(0, 162, 255);
  opacity: 0.5;
}

.reaction-wrapper {
  width: 100%;
  height: 50px;
  display: flex;
  margin-top: -25px;
  align-items: center;
}

.reaction-wrapper .icon {
  height: 25px;
  margin: 0;
  margin-right: 20px;
}

.reaction-wrapper .icon.save {
  margin-left: auto;
}

.right-col {
  padding: 20px;
}

.profile-card {
  width: fit-content;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}

.profile-card .profile-pic {
  flex: 0 0 auto;
  padding: 0;
  background: none;
  width: 40px;
  height: 40px;
  margin-right: 10px;
}

.profile-card:first-child .profile-pic {
  width: 70px;
  height: 70px;
}

.profile-card .profile-pic img {
  border: none;
}

.profile-card .username {
  font-weight: 500;
  font-size: 14px;
  color: #000;
}

.sub-text {
  color: rgba(0, 0, 0, 0.5);
  font-size: 12px;
  font-weight: 500;
  margin-top: 5px;
}

.action-btn {
  opacity: 1;
  font-weight: 700;
  font-size: 12px;
}

.suggestion-text {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.5);
  font-weight: 700;
  margin: 20px 0;
}

@media (max-width: 1100px) {
  .right-col,
  .search-box {
    display: none;
  }
  .nav-wrapper,
  .wrapper {
    width: 90%;
  }
  .wrapper {
    display: block;
  }
}

@media (max-width: 500px) {
  .nav-items .icon {
    margin: 0 5px;
  }
  .post-image {
    height: 300px;
  }
}
</style>

  
  
  
</head>

<body translate="no">
  <nav class="navbar">
  <div class="nav-wrapper">
    <i class="fa-brands fa-instagram"> <span class="logo"> Instagram Postlet</span></i>
    <input type="text" class="search-box" placeholder="search">
    <div class="nav-items">
      <i class="fa-solid fa-house icon" alt=""></i>
      <i class="fa-regular fa-comment icon" alt=""></i>
      <i class="fa-regular fa-pen-to-square icon" alt=""></i>
      <i class="fa-regular fa-heart icon" alt=""></i>
      <i class="fa-regular fa-compass icon" alt=""></i>
      <i class="fa-regular fa-user icon" alt=""></i>
      <div class="icon user-profile"></div>
    </div>
  </div>
</nav>

<section class="main">
  <div class="wrapper">
    <div class="left-col">
      <div class="status-wrapper">
        <div class="status-card">
          <div class="profile-pic"><img src="https://picsum.photos/id/144/200/200" alt=""></div>
          <p class="username">user_name_1</p>
        </div>
        <div class="status-card">
          <div class="profile-pic"><img src="https://picsum.photos/id/244/200/200" alt=""></div>
          <p class="username">user_name_2</p>
        </div>
        <div class="status-card">
          <div cl.........完整代码请登录后点击上方下载按钮下载查看

网友评论0