网格卡片布局
本课属于 Coddy HTML 学习旅程的“精通 CSS”单元。第 42 课,共 43 课。
挑战
简单使用 CSS Grid 为卡片创建一个简单的两列布局。
- 卡片应显示为两个等宽的列。
- 卡片之间应留出一些间距。
亲手试试
<html>
<head>
<title>Grid Card Layout</title>
<style>
.card {
background-color: #0252c9;
padding: 16px;
border-radius: 8px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
/* Add your styles here */
</style>
</head>
<body>
<div class="card-container">
<div class="card">
<h3>Card 1</h3>
<p>This is the first card with some text.</p>
</div>
<div class="card">
<h3>Card 2</h3>
<p>This is the second card with more content.</p>
</div>
</div>
</body>
</html>
精通 CSS中的所有课
自己练习: Web 在线编辑器