Grid Card Layout
Part of the CSS Mastery section of Coddy's HTML journey — lesson 42 of 43.
Challenge
EasyCreate a simple 2-column layout for the cards using CSS Grid.
- The cards should be displayed in two equal columns.
- There should be some space between the cards.
Try it yourself
<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>
All lessons in CSS Mastery
1Selector Mastery – Combination
IntroductionDescendant SelectorChild SelectorAdjacent Sibling SelectorGeneral Sibling SelectorRecap Challenge3Structural pseudo-classes
Structural pseudo-classesTargeting the First ChildTargeting the Last ChildPattern Power: Using nth-childRecap Challenge6Landing Page
Style the Header SectionStyle the buttonSection Layout Card Layout Add Finishing Touches9Final Challenges
Highlight Active MenuZebra Table RowsButton Hover EffectGrid Card LayoutBlurred Hero Image