Challenge: Decorative Effects
Task
Let's practice and enhance the visual appeal of the webpage. The task includes:
- Add a shadow to the
div
element with the class namecard
. The specified shadow values arergba(0, 0, 0, 0.3) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px
. - Add a background image to the
div
element with the class namecard
. The image link is provided:https://codefinity-content-media.s3.eu-west-1.amazonaws.com/code-1/css-fundamentals/decorative-effects/challenge-background.png
. - Center the background image within the card.
index.html
index.css
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="index.css" />
</head>
<body>
<div class="card">
<div class="card-content">
<h2>Weather</h2>
<p>Today's forecast</p>
<a href="#" class="btn">Learn more...</a>
</div>
</div>
</body>
</html>
.card {
margin: 0 auto;
width: 460px;
height: 360px;
border-radius: 10px;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
/* Change code below this line */
box-shadow: ___;
background-image: ___;
background-position: ___;
/* Change code above this line */
}
.card-content {
display: block;
margin: 0 auto;
border-radius: 10px;
padding: 30px;
background-color: rgba(78, 12, 87, 0.9);
}
h2 {
color: #fff;
margin: 0;
font-size: 3rem;
margin-bottom: 10px;
}
p {
color: #fff;
margin: 0;
font-size: 2rem;
font-weight: 600;
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 5. Kapittel 6