css+div卡片瀑布流布局效果代码

代码语言:html

所属分类:布局界面

代码描述:css+div卡片瀑布流布局效果代码

代码标签: 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>
				<.........完整代码请登录后点击上方下载按钮下载查看

网友评论0