Tell us what’s happening:
No matter what I put in the styles.css, none of the checkboxes get checked. I think this lab is bugged? Can anyone help. My first 7 steps are checked, which is the HTML portion. I’m following these instructions to a tee:
- You should build a webpage that displays at least three playing cards.
- You should have a
mainelement with an ID ofplaying-cards. - Within your
#playing-cardselement, you should have at least threedivelements, each with a class ofcard. - Within each
.cardelement, you should have threedivelements, the first with a class ofleft, the second with a class ofmiddle, and the third with a class ofright. - Your
#playing-cardselement should use flexbox to horizontally center its children, allow them to wrap, and put a20pxspace between them. - Each of your
.cardelements should use flexbox to justify its children usingspace-between. - Each of your
.leftelements should use flexbox item properties to align itself at the start of its’ parent container. - Each of your
.middleelements should use flexbox item properties to align itself in the center of its’ parent container. - Each of your
.rightelements should use flexbox item properties to align itself at the end of its parent container. - Each of your
.middleelements should use flexbox to display its children in a column.
-
- You should have a
mainelement with anidofplaying-cards.
- You should have a
-
Passed:2. You should have at least three
divelements with a class ofcardwithin your#playing-cardselement. -
Passed:3. Each of your
.cardelements should have a width and height. -
Passed:4. Each of your
.cardelements should have exactly threedivelements as children. -
Passed:5. You should have a
divwith a class ofleftwithin each.cardelement. -
Passed:6. You should have a
divwith a class ofmiddlewithin each.cardelement. -
Passed:7. You should have a
divwith a class ofrightwithin each.cardelement. -
- You should have a
#playing-cardsselector that sets its elements’displaytoflex.
- You should have a
-
Failed:9. You should have a
#playing-cardsselector that sets its elements’justify-contenttocenter. -
Failed:10. You should have a
#playing-cardsselector that sets its elements’flex-wraptowrap. -
Failed:11. You should have a
#playing-cardsselector that sets its elements’gapto20px. -
Failed:12. You should have a
.cardselector that sets its elements’displaytoflex. -
Failed:13. You should have a
.cardselector that sets its elements’justify-contenttospace-between. -
Failed:14. You should have a
.leftselector that sets its elements’align-selftoflex-start. -
Failed:15. You should have a
.middleselector that sets its elements’align-selftocenter. -
Failed:16. You should have a
.rightselector that sets its elements’align-selftoflex-end. -
Failed:17. You should have a
.middleselector that sets its elements’flex-directiontocolumn.
Your code so far
body {
background-color: Thistle;
min-height: 100vh;
}
.red {
color: red;
}
.flipped {
transform: rotate(180deg);
}
#playing-cards {
margin-top: 100px;
display: flex;
justify-content: center;
gap: 20px;
flex-wrap: wrap;
}
.card {
background-color: white;
border: 1px solid black;
border-radius: 10px;
box-shadow: 2px 2px 2px gray;
min-width: 250px;
max-width: 250px;
height: 350px;
font-size: 30px;
font-weight: bold;
padding: 5px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
text-align: center;
}
.left {
align-self: flex-start;
}
.middle {
align-self: center;
display: flex;
font-size: 80px;
flex-direction: column;
}
.right {
align-self: flex-end;
}
.middle-section {
display: flex;
justify-content: center;
}
<!-- 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>
</head>
<body>
<main id="playing-cards">
<div class="card">
<div class="left">♠</div>
<div class="middle">♥</div>
<div class="right">♦</div>
</div>
<div class="card">
<div class="left">♠</div>
<div class="middle">♥</div>
<div class="right">♦</div>
</div>
<div class="card">
<div class="left">♠</div>
<div class="middle">♥</div>
<div class="right">♦</div>
</div>
</main>
</body>
</html>
/* file: styles.css */
* {
box-sizing: border-box;
}
#playing-cards {
display: flex;
justify-content: center;
gap: 20px;
flex-wrap: wrap;
flex-direction: row;
max-width: 600px;
margin: 0 auto;
padding: 30px 10px;
}
#playing-cards::after {
content: "";
width: 180px;
}
.card {
justify-content: space-between;
height: 300px;
border: 2px solid black;
width: 180px;
display: flex;
line-height: .8em
}
#playing-cards::after {
content: "";
width: 380px;
}
.left {
align-self: flex-start;
vertical-align: top;
font-size: 40px;
flex-wrap: wrap;
line-height: .8em;
padding: 5px;
}
.middle {
display: flex;
align-self: center;
flex-direction: column;
color: red;
font-size: 40px;
align-items: center;
line-height: .8em;
}
.right {
align-self: flex-end;
font-size: 40px;
line-height: .8em;
transform: rotate(180deg);
padding: 5px;
}
span {
transform: rotate(180deg);
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Challenge Information:
Build a Page of Playing Cards - Build a Page of Playing Cards
https://www.freecodecamp.org/learn/full-stack-developer/lab-page-of-playing-cards/build-a-page-of-playing-cards
