css+div卡片瀑布流布局效果代码
代码语言:html
所属分类:布局界面
代码描述:css+div卡片瀑布流布局效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;500&display=swap'); *{ margin:0;font-family: 'Ubuntu', sans-serif; font-weight:300;} section{ display:grid; grid-template-columns:1fr 1fr 1fr; padding:1rem; gap:1rem; background-color:#2A2C36; } .row{ grid-row: span 1; display:flex; flex-direction:column; gap:1rem; } .card{ padding:1rem; background-color:#373841; border-radius:1rem; color:#fff; box-shadow:0 3px 10px rgba(0,0,0,0.3) } .user{ display:flex; justify-content:space-between; align-items:center; margin-bottom:15px; } .avatar{ width:50px; height:50px; border-radius:5px; background-color:#fff; } .user h3{ font-weight:600; margin:5px 0; } .user span{ color:#aaa; } .meta{ margin-top:15px; color:#aaa; font-size:0.8rem; float:right; display:inline-block; } .meta > span{ position:relative; display:inline-block; margin: 0 10px; }.meta>span:nth-of-type(1)::before{ content:''; position:absolute; border-radius:50rem; height:7px; width:7px; background-color:#aaa; left:calc(100% + 7px); top:calc(15px/ 2 - 7px /2) } .review{ font-size:1rem; line-height:1.3rem; color:#ddd; } </style> </head> <body > <section> <div class="row"> <div class="card"> <div class="user"> <div class="avatar"></div> <div> <h3>John</h3> <span>@john</span> </div> </div> <p class="review">Lorem ipsum, dolor sit amet consectetur adipisicing elit. Qui facere, sequi, rem, consequuntur voluptate quasi iste natus assumenda cupiditate dolorum molestias porro magnam. Voluptatibus cum quo assumenda ut quod dolore.</p> <div class="meta"><span>April 23, 2024</span><span>8:30 AM</span></div> </div> <div class="card"> <div class="user"> <div class="avatar"></div> <div> <h3>Colt</h3> <span>@itscolt</span> </div> </div> <p class="review">Lorem ipsum dolor sit amet consectetur adipisicing elit. Debitis corrupti labore commodi illum accusamus enim dolor, est dignissimos fuga officiis unde rem cupiditate minima tempore aperiam repudiandae consequuntur repellat placeat? Animi voluptatem accusantium tempore tenetur impedit, consequuntur dolore fugit temporibus!</p> <div class="meta"><span>April 2, 2024</span><span>9:42 PM</span></div> </div> <div class="card"> <div class="user"> <div class="avatar"></div> <div> <h3>Tom</h3> <span>@adrenaline</span> </div> </div> <p class="review">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Unde, animi!</p> <div class="meta"><span>March 14, 2024</span><span>3:27 PM</span></div> </div> <div class="card"> <div class="user"> <div class="avatar"></div> <div> <h3>Ashok</h3> <span>@as.hok</span> </div> </div> <p class="review">Lorem ipsum, dolor sit amet consectetur adipisicing elit. Cumque laboriosam dolores aut. Aspernatur unde doloremque doloribus temporibus, ducimus, iste explicabo facere debitis quaerat qui, cumque distinctio ut modi quasi saepe sint deleniti veritatis quae neque! Optio quia officiis minus fuga dignissimos libero. In odio accusamus, magnam quia eius dolorum, eum architecto ipsum assumenda tempora nulla minus libero pariatur nemo minima?</p> <div class="meta"><span>March 31, 2024</span><span>1:03 AM</span></div> </div> </div> <div class="row"> <div class="card"> <div class="user"> <div class="avatar"></div> <div> <h3>Jessie</h3> <span>@jesscat</span> </div> </div> <p class="review">Lorem ipsum dolor, sit amet consectetur adipisicing elit. Similique consequuntur voluptate et, expedita doloremque repellat quae, ullam corrupti autem enim obcaecati voluptates odit atque.</p> <div class="meta"><span>March 7, 2024</span><span>11:45 AM</span></div> </div> <div class="card"> <div class="user"> <div class="avatar"></div> <div> <h3>Tyler</h3> <span>.........完整代码请登录后点击上方下载按钮下载查看
网友评论0