- index.html
- style.css
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Introduction to custom properties</title>
<link rel="stylesheet" href="card.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<article class="card">
<img class="card__image" src="karpovka-400.jpg" width="200" height="100" alt="Karpovka Embankment">
<div class="card__content">
<h2 class="card__title">Karpovka Embankment</h2>
<p class="card__description">
A scenic place for a walk in Saint Petersburg.
</p>
<a class="card__button" href="#">Learn more</a>
</div>
</article>
</body>
</html>
CSS
.card {
--card-color: #14a76c;
}
.card__title {
color: var(--card-color);
}
.card__button {
background-color: var(--card-color);
}
.card__image {
}
You’ve gone to a different page
Goalscompleted
0
- In the
.cardrule, declare--card-radiuswith the value12px. - In the
.cardrule, setborder-radius: var(--card-radius). - In the
.card__imagerule, setborder-radius: var(--card-radius).
Comments