- index.html
- style.css
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Baseline alignment</title>
<link href="course.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">
</head>
<body class="house">
<div class="room room-1">
<div class="rug text-rudolf">
<p>Rudolf</p>
</div>
<div class="rug text-muffin">
<p>Muffin</p>
</div>
<div class="rug text-simba">
<p>Simba</p>
</div>
</div>
<div class="room room-2">
<div class="rug text-rudolf">
<p>Rudolf</p>
</div>
<div class="rug text-muffin">
<p>Muffin</p>
</div>
<div class="rug text-simba">
<p>Simba</p>
</div>
</div>
</body>
</html>
CSS
.room {
display: flex;
height: 150px;
justify-content: center;
}
.room-1 {
align-items: center;
}
.room-2 {
align-items: center;
}
.rug {
min-height: auto;
}
.rug p {
margin: 30px 0;
text-align: center;
background-color: rgba(69, 185, 244, 0.25);
}
You’ve gone to a different page
Goalscompleted
0
- Set the flex items to be aligned at the start of the cross axis for the
.room-1
block, - and set alignment along the text baseline for the
.room-2
block.
Comments