
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
크리스마스 캘린더를 24일 카드 사이즈의 카드가 8개 보여지는 형태로 변경하고자 합니다.
어찌어찌 코드를 작성해보았는데요...
리플릿 화면에서는 괜찮게 보여졌는데 new tab 에서 보니 카드 크기가 가로로 너무 커지고,
인터넷 창을 작게 줄이면 기존 코드를 반응형으로 비율에 맞춰 줄어들었는데, 제가 작성한 코드로는 높이가 고정되어 있는 것으로 보여집니다.
제가 원하는 것은
혹시 어디를 수정하면 될지 여쭤볼 수 있을까요?
"t t d1 d1 d2 d2"
"t t d1 d1 d2 d2"
"d3 d3 d4 d4 d5 d5"
"d3 d3 d4 d4 d5 d5"
"d6 d6 d7 d7 d8 d8"
"d6 d6 d7 d7 d8 d8"



작성한 코드 및 에러 메세지
index.css >
body {
background-image: url("image/bg.png");
background-size: cover;
background-position: center;
}
body {
background-color: black;
color: white;
font-weight: bold;
}
/* 그리드 설계 */
.grid-1 {
display: grid;
width: 100vw;
max-width: 100%;
margin: 2% auto;
z-index: 1;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: auto;
grid-gap: 25px;
grid-template-areas:
"t t"
"d1 d2"
"d3 d4"
"d5 d6"
"d7 d8";
}
@media only screen and (min-width: 300px) {
.grid-1 {
/* 너비를 기준으로 높이를 계산 */
grid-template-columns: repeat(6, 1fr);
grid-template-areas:
"t t d1 d1 d2 d2"
"t t d1 d1 d2 d2"
"d3 d3 d4 d4 d5 d5"
"d3 d3 d4 d4 d5 d5"
"d6 d6 d7 d7 d8 d8"
"d6 d6 d7 d7 d8 d8";
}
}
/* flex 속성 */
.flex-row {
display: flex;
}
.flex-col {
display: flex;
flex-direction: column;
}
.item-baseline {
align-items: baseline;
}
.title {
display: flex;
align-items: baseline;
justify-content: center;
grid-area: t;
}
.title img {
width: auto;
height: auto;
}
/* 그리드 별 배경 이미지 */
.day-1 {
grid-area: d1;
background: url("image/frame/frame1.png");
background-position: center;
background-size: cover;
}
.day-1 .back {
background-image: url("image/card/card-1.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-2 {
grid-area: d2;
background: url("image/frame/frame2.png");
background-position: center;
background-size: cover;
}
.day-2 .back {
background-image: url("image/card/card-2.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-3 {
grid-area: d3;
background: url("image/frame/frame3.png");
background-position: center;
background-size: cover;
}
.day-3 .back {
background-image: url("image/card/card-3.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-4 {
grid-area: d4;
background: url("image/frame/frame4.png");
background-position: center;
background-size: cover;
}
.day-4 .back {
background-image: url("image/card/card-4.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-5 {
grid-area: d5;
background: url("image/frame/frame5.png");
background-position: center;
background-size: cover;
}
.day-5 .back {
background-image: url("image/card/card-5.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-6 {
grid-area: d6;
background: url("image/frame/frame6.png");
background-position: center;
background-size: cover;
}
.day-6 .back {
background-image: url("image/card/card-6.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-7 {
grid-area: d7;
background: url("image/frame/frame7.png");
background-position: center;
background-size: cover;
}
.day-7 .back {
background-image: url("image/card/card-7.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-8 {
grid-area: d8;
background: url("image/frame/frame8.png");
background-position: center;
background-size: cover;
}
.day-8 .back {
background-image: url("image/card/card-8.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-9 {
grid-area: d9;
background: url("image/frame/frame9.png");
background-position: center;
background-size: cover;
}
.day-9 .back {
background-image: url("image/card/card-9.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-10 {
grid-area: d10;
background: url("image/frame/frame10.png");
background-position: center;
background-size: cover;
}
.day-10 .back {
background-image: url("image/card/card-10.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-11 {
grid-area: d11;
background: url("image/frame/frame11.png");
background-position: center;
background-size: cover;
}
.day-11 .back {
background-image: url("image/card/card-11.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-12 {
grid-area: d12;
background: url("image/frame/frame12.png");
background-position: center;
background-size: cover;
}
.day-12 .back {
background-image: url("image/card/card-12.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-13 {
grid-area: d13;
background: url("image/frame/frame13.png");
background-position: center;
background-size: cover;
}
.day-13 .back {
background-image: url("image/card/card-13.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-14 {
grid-area: d14;
background: url("image/frame/frame14.png");
background-position: center;
background-size: cover;
}
.day-14 .back {
background-image: url("image/card/card-14.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-15 {
grid-area: d15;
background: url("image/frame/frame15.png");
background-position: center;
background-size: cover;
}
.day-15 .back {
background-image: url("image/card/card-15.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-16 {
grid-area: d16;
background: url("image/frame/frame16.png");
background-position: center;
background-size: cover;
}
.day-16 .back {
background-image: url("image/card/card-16.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-17 {
grid-area: d17;
background: url("image/frame/frame17.png");
background-position: center;
background-size: cover;
}
.day-17 .back {
background-image: url("image/card/card-17.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-18 {
grid-area: d18;
background: url("image/frame/frame18.png");
background-position: center;
background-size: cover;
}
.day-18 .back {
background-image: url("image/card/card-18.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-19 {
grid-area: d19;
background: url("image/frame/frame19.png");
background-position: center;
background-size: cover;
}
.day-19 .back {
background-image: url("image/card/card-19.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-20 {
grid-area: d20;
background: url("image/frame/frame20.png");
background-position: center;
background-size: cover;
}
.day-20 .back {
background-image: url("image/card/card-20.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-21 {
grid-area: d21;
background: url("image/frame/frame21.png");
background-position: center;
background-size: cover;
}
.day-21 .back {
background-image: url("image/card/card-21.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-22 {
grid-area: d22;
background: url("image/frame/frame22.png");
background-position: center;
background-size: cover;
}
.day-22 .back {
background-image: url("image/card/card-22.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-23 {
grid-area: d23;
background: url("image/frame/frame23.png");
background-position: center;
background-size: cover;
}
.day-23 .back {
background-image: url("image/card/card-23.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-24 {
grid-area: d24;
background: url("image/frame/frame24.png");
background-position: center;
background-size: cover;
}
.day-24 .back {
background-image: url("image/card/card-24.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
/* door styles */
.grid-1 input {
display: none;
}
label {
perspective: 1000px;
transform-style: preserve-3d;
cursor: pointer;
display: flex;
min-height: 100%;
width: 100%;
height: auto;
}
/* flex 속성 */
.flex-row {
display: flex;
}
.flex-col {
display: flex;
flex-direction: column;
}
.item-baseline {
align-items: baseline;
}
.title {
display: flex;
align-items: baseline;
justify-content: center;
grid-area: t;
}
.title img {
width: 90%;
height: auto;
}
/* 그리드 별 배경 이미지 */
.day-1 {
grid-area: d1;
background: url("image/frame/frame1.png");
background-position: center;
background-size: cover;
}
.day-1 .back {
background-image: url("image/card/card-1.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-2 {
grid-area: d2;
background: url("image/frame/frame2.png");
background-position: center;
background-size: cover;
}
.day-2 .back {
background-image: url("image/card/card-2.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-3 {
grid-area: d3;
background: url("image/frame/frame3.png");
background-position: center;
background-size: cover;
}
.day-3 .back {
background-image: url("image/card/card-3.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-4 {
grid-area: d4;
background: url("image/frame/frame4.png");
background-position: center;
background-size: cover;
}
.day-4 .back {
background-image: url("image/card/card-4.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-5 {
grid-area: d5;
background: url("image/frame/frame5.png");
background-position: center;
background-size: cover;
}
.day-5 .back {
background-image: url("image/card/card-5.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-6 {
grid-area: d6;
background: url("image/frame/frame6.png");
background-position: center;
background-size: cover;
}
.day-6 .back {
background-image: url("image/card/card-6.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-7 {
grid-area: d7;
background: url("image/frame/frame7.png");
background-position: center;
background-size: cover;
}
.day-7 .back {
background-image: url("image/card/card-7.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-8 {
grid-area: d8;
background: url("image/frame/frame8.png");
background-position: center;
background-size: cover;
}
.day-8 .back {
background-image: url("image/card/card-8.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-9 {
grid-area: d9;
background: url("image/frame/frame9.png");
background-position: center;
background-size: cover;
}
.day-9 .back {
background-image: url("image/card/card-9.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-10 {
grid-area: d10;
background: url("image/frame/frame10.png");
background-position: center;
background-size: cover;
}
.day-10 .back {
background-image: url("image/card/card-10.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-11 {
grid-area: d11;
background: url("image/frame/frame11.png");
background-position: center;
background-size: cover;
}
.day-11 .back {
background-image: url("image/card/card-11.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-12 {
grid-area: d12;
background: url("image/frame/frame12.png");
background-position: center;
background-size: cover;
}
.day-12 .back {
background-image: url("image/card/card-12.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-13 {
grid-area: d13;
background: url("image/frame/frame13.png");
background-position: center;
background-size: cover;
}
.day-13 .back {
background-image: url("image/card/card-13.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-14 {
grid-area: d14;
background: url("image/frame/frame14.png");
background-position: center;
background-size: cover;
}
.day-14 .back {
background-image: url("image/card/card-14.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-15 {
grid-area: d15;
background: url("image/frame/frame15.png");
background-position: center;
background-size: cover;
}
.day-15 .back {
background-image: url("image/card/card-15.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-16 {
grid-area: d16;
background: url("image/frame/frame16.png");
background-position: center;
background-size: cover;
}
.day-16 .back {
background-image: url("image/card/card-16.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-17 {
grid-area: d17;
background: url("image/frame/frame17.png");
background-position: center;
background-size: cover;
}
.day-17 .back {
background-image: url("image/card/card-17.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-18 {
grid-area: d18;
background: url("image/frame/frame18.png");
background-position: center;
background-size: cover;
}
.day-18 .back {
background-image: url("image/card/card-18.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-19 {
grid-area: d19;
background: url("image/frame/frame19.png");
background-position: center;
background-size: cover;
}
.day-19 .back {
background-image: url("image/card/card-19.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-20 {
grid-area: d20;
background: url("image/frame/frame20.png");
background-position: center;
background-size: cover;
}
.day-20 .back {
background-image: url("image/card/card-20.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-21 {
grid-area: d21;
background: url("image/frame/frame21.png");
background-position: center;
background-size: cover;
}
.day-21 .back {
background-image: url("image/card/card-21.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-22 {
grid-area: d22;
background: url("image/frame/frame22.png");
background-position: center;
background-size: cover;
}
.day-22 .back {
background-image: url("image/card/card-22.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-23 {
grid-area: d23;
background: url("image/frame/frame23.png");
background-position: center;
background-size: cover;
}
.day-23 .back {
background-image: url("image/card/card-23.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
.day-24 {
grid-area: d24;
background: url("image/frame/frame24.png");
background-position: center;
background-size: cover;
}
.day-24 .back {
background-image: url("image/card/card-24.png");
background-position: center;
background-size: cover;
border-radius: 10px;
}
/* door styles */
.grid-1 input {
display: none;
}
label {
perspective: 1000px;
transform-style: preserve-3d;
cursor: pointer;
display: flex;
min-height: 100%;
width: 100%;
height: 300px;
}
/* 카드 앞면 */
.door {
width: 100%;
transform-style: preserve-3d;
transition: all 300ms;
border-radius: 10px;
}
.date-num {
position: absolute;
top: 14px;
left: 14px;
color: white;
}
