Tell us what’s happening:
I can’t align my symbols in the middle and don’t understand how it works. I used background as an aid and still don’t comprehend everything about the flexbox.
Your code so far
<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Playing Cards</title>
<link href="./styles.css" rel="stylesheet">
</head>
<body>
<main id="playing-cards">
<div class="card">
<div class="left spikel">
</div>
<div class="middle spikem">
</div>
<div class="right spiker">
</div>
</div>
<div class="card">
<div class="left hearthl">
</div>
<div class="middle hearthm">
</div>
<div class="right hearthr">
</div>
</div>
<div class="card">
<div class="left">
</div>
<div class="middle">
</div>
<div class="right">
</div>
</div>
</main>
</body>
</html>
/* file: styles.css */
body{
background-color:green;
}
#playing-cards{
display:flex;
justify-content: center;
flex-wrap:wrap;
gap:20px;
margin: 10px auto;
}
.card{
display:flex;
justify-content:space-between;
background:whitesmoke;
width:150px;
height:250px;
border-radius:20px;
font-family:sans-serif;
font-weight:bold;
font-size: 2rem;
padding:4px;
}
.left{
align-self:flex-start;
width:25px;
margin-left:5px;
flex-wrap:wrap;
line-height:1.5rem;
}
.middle{
display:flex;
flex-direction:column;
flex-wrap:no-wrap;
width:60px;
align-self:center;
}
.right{
align-self:flex-end;
width:25px;
margin-right:5px;
flex-wrap:wrap;
line-height:1.5rem;
transform:rotate(180deg);
}
.hearthl::after, .hearthr::after{
content:"5 ♥";
color:red;
}
.hearthm::after{
content:"♥ ♥ ♥ ♥ ♥";
color:red;
}
.spiker::after, .spikel::after{
content:"3 ♠";
}
.spikem::after{
content:"♠ ♠ ♠";
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:146.0) Gecko/20100101 Firefox/146.0
Challenge Information:
Build a Page of Playing Cards - Build a Page of Playing Cards