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
main
element with an ID ofplaying-cards
. - Within your
#playing-cards
element, you should have at least threediv
elements, each with a class ofcard
. - Within each
.card
element, you should have threediv
elements, the first with a class ofleft
, the second with a class ofmiddle
, and the third with a class ofright
. - Your
#playing-cards
element should use flexbox to horizontally center its children, allow them to wrap, and put a20px
space between them. - Each of your
.card
elements should use flexbox to justify its children usingspace-between
. - Each of your
.left
elements should use flexbox item properties to align itself at the start of its’ parent container. - Each of your
.middle
elements should use flexbox item properties to align itself in the center of its’ parent container. - Each of your
.right
elements should use flexbox item properties to align itself at the end of its parent container. - Each of your
.middle
elements should use flexbox to display its children in a column.
-
- You should have a
main
element with anid
ofplaying-cards
.
- You should have a
-
Passed:2. You should have at least three
div
elements with a class ofcard
within your#playing-cards
element. -
Passed:3. Each of your
.card
elements should have a width and height. -
Passed:4. Each of your
.card
elements should have exactly threediv
elements as children. -
Passed:5. You should have a
div
with a class ofleft
within each.card
element. -
Passed:6. You should have a
div
with a class ofmiddle
within each.card
element. -
Passed:7. You should have a
div
with a class ofright
within each.card
element. -
- You should have a
#playing-cards
selector that sets its elements’display
toflex
.
- You should have a
-
Failed:9. You should have a
#playing-cards
selector that sets its elements’justify-content
tocenter
. -
Failed:10. You should have a
#playing-cards
selector that sets its elements’flex-wrap
towrap
. -
Failed:11. You should have a
#playing-cards
selector that sets its elements’gap
to20px
. -
Failed:12. You should have a
.card
selector that sets its elements’display
toflex
. -
Failed:13. You should have a
.card
selector that sets its elements’justify-content
tospace-between
. -
Failed:14. You should have a
.left
selector that sets its elements’align-self
toflex-start
. -
Failed:15. You should have a
.middle
selector that sets its elements’align-self
tocenter
. -
Failed:16. You should have a
.right
selector that sets its elements’align-self
toflex-end
. -
Failed:17. You should have a
.middle
selector that sets its elements’flex-direction
tocolumn
.
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