- index.html
- style.css
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Calculating the total size with flex-grow</title>
<link href="course.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">
</head>
<body class="world world-flat">
<div class="spot spot-1">
<div class="skate no-width racoon-green"></div>
<div class="skate no-width racoon-brown"></div>
<div class="ruler ruler-green w-100">100px</div>
<div class="ruler ruler-brown w-200 l-100">200px</div>
</div>
<div class="spot spot-2">
<div class="skate no-width racoon-green"></div>
<div class="skate no-width racoon-brown"></div>
<div class="ruler ruler-green w-200">200px</div>
<div class="ruler ruler-brown w-300 l-200">300px</div>
</div>
</body>
</html>
CSS
.spot {
display: flex;
padding: 10px 0;
height: 100px;
}
.spot-1 {
width: 300px;
}
.spot-1 .skate {
flex-basis: 0;
min-width: 50px;
}
.spot-1 .racoon-green {
flex-grow: 0;
}
.spot-1 .racoon-brown {
flex-grow: 0;
}
.spot-2 {
width: 500px;
}
.spot-2 .skate {
flex-basis: 0;
min-width: 50px;
}
.spot-2 .racoon-green {
flex-grow: 0;
}
.spot-2 .racoon-brown {
flex-grow: 0;
}
You’ve gone to a different page
Goalscompleted
0
- Assign the value
flex-grow
to the raccoons in the.spot-1
upper clearing so that their width is equal to the width of the bars. - Do the same thing with the raccoons in the
.spot-2
lower clearing.
In this assignment you can only change the values of flex-grow
,
Comments