- index.html
- style.css
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Course card, part 3</title>
<link href="course.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">
</head>
<body class="subtle">
<section class="cards">
<article class="card">
<h1 class="card-heading">2D-transformations</h1>
<div class="card-meta">
<div class="card-category">
<span class="card-icon icon-tag">Category: </span>
<span>HTML, CSS</span>
</div>
<div class="card-duration">
<span class="card-icon icon-time">Course time: </span>
<span>2 hours</span>
</div>
</div>
<div class="card-content">
<figure class="card-figure">
<img class="card-img" src="img/course-2.png" alt="Muffin">
<figcaption>
<p>We will learn how to rotate, tilt, move, shrink, and magnify objects, and we will even learn how to blow them up with fireballs.</p>
</figcaption>
</figure>
<button class="card-button">Start course</button>
</div>
</article>
<article class="card">
<h1 class="card-heading">Animation</h1>
<div class="card-meta">
<div class="card-category">
<span class="card-icon icon-tag">Category: </span>
<span>HTML, CSS</span>
</div>
<div class="card-duration">
<span class="card-icon icon-time">Course time: </span>
<span>2 hours</span>
</div>
</div>
<div class="card-content">
<figure class="card-figure">
<img class="card-img" src="img/course-4.png" alt="Muffin">
<figcaption>
<p>The course covers the basics of CSS animation.</p>
</figcaption>
</figure>
<button class="card-button">Start course</button>
</div>
</article>
</section>
</body>
</html>
CSS
.cards {
display: flex;
}
.card {
display: flex;
flex-direction: column;
margin: 10px;
padding: 20px;
max-width: 70%;
}
.card-meta {
display: flex;
}
.card-category {
flex-grow: 1;
}
.card-content {
}
.card-img {
width: 100%;
}
.card-button {
}
/* Decorative outlines */
.card > * {
outline: 2px solid rgba(0, 128, 0, 0.3);
outline-offset: 1px;
}
.card-content > * {
outline: 2px solid rgba(0, 0, 0, 0.5);
outline-offset: -3px;
}
You’ve gone to a different page
Goalscompleted
0
- Assign a growth factor of
1
for.card-content
, - then configure it to use a flexbox layout,
- and set the direction of flow of the main axis to from top to bottom.
- And set a top margin of
auto
for the.card-button
button.
Comments