<div class="quiz__wrap">
<div class="quiz">
<h2 class="quiz__type"></h2>
<h3 class="quiz__question">
<span class="quiz__number"></span>
<span class="quiz__ask"></span>
</h3>
<div class="quiz__view">
<div class="dog">
<div class="dog">
<div class="head">
<div class="ears"></div>
<div class="face"></div>
<div class="eyes">
<div class="teardrop"></div>
</div>
<div class="nose"></div>
<div class="mouth">
<div class="tongue"></div>
</div>
<div class="chin"></div>
</div>
<div class="body">
<div class="tail"></div>
<div class="legs"></div>
</div>
</div>
</div>
</div>
<div class="quiz__answer">
<button class="quiz__confirm">정답 확인하기</button>
<div class="quiz__result"></div>
</div>
</div>
</div>
.quiz__wrap {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
margin-top: 150px;
}
.quiz {
max-width: 500px;
width: 100%;
background: #fff;
border: 8px ridge #cacaca;
margin: 10px;
}
.quiz__type {
background: #cacaca;
text-align: center;
font-size: 14px;
color: #3b3b3b;
border: 3px ridge #cacaca;
padding: 3px 0;
position: relative;
}
.quiz__type::before {
content: '';
position: absolute;
left: 2px; top: 4px;
width: 5px;
height: 5px;
border: 6px ridge #ffffff;
}
.quiz__type::after {
content: '';
position: absolute;
right: 2px; top: 4px;
width: 5px;
height: 5px;
border: 6px ridge #ffffff;
}
.quiz__question {
border-top: 6px ridge #cacaca;
border-bottom: 6px ridge #cacaca;
padding: 13px 30px;
font-size: 24px;
line-height: 1.4;
}
.quiz__number {
font-family: 'Cafe24Dangdanghae';
color: #64a30b;
}
.quiz__ask {
font-family: 'Cafe24Dangdanghae';
}
.quiz__view {
background: #f5f5f5;
}
.quiz__answer {
border-top: 6px ridge #cacaca;
background: #f5f5f5;
padding: 10px;
}
.quiz__confirm {
border: 6px ridge #ffffff;
width: 100%;
font-size: 22px;
padding: 13px 20px;
background: #d6d6d6;
font-family: 'Cafe24Dangdanghae';
text-shadow: 1px 1px 1px #fff;
transition: all 0.3s;
cursor: pointer;
}
.quiz__confirm:hover {
background: #b3b3b3;
}
.quiz__result {
border: 6px ridge #ffffff;
width: 100%;
font-size: 22px;
padding: 13px 20px;
background: #fff;
text-align: center;
font-family: 'Cafe24Dangdanghae';
text-shadow: 1px 1px 1px #fff;
display: none;
}
.source-btn {
font-family: 'Cafe24Dangdanghae';
position: absolute;
right: 47%; bottom: 100px;
font-size: 16px;
padding: 10px 30px;
border-radius: 50px;
transition: all 0.2s;
cursor: pointer;
}
.source-btn:hover {
background: #000;
color: #fff;
}
const quizType = document.querySelector(".quiz__type");
const quizNumber = document.querySelector(".quiz__number");
const quizAsk = document.querySelector(".quiz__ask");
const quizConfirm = document.querySelector(".quiz__confirm");
const quizResult = document.querySelector(".quiz__result");
const quizDog = document.querySelector(".quiz__view .dog")
const answerType = "HTML";
const answerNum = 1;
const answerAsk = "컨텐츠의 구조를 정의하는 마크업 언어는 무엇일까요?";
const answerResult = "html"
quizType.textContent = answerType;
quizNumber.textContent = answerNum + ". ";
quizAsk.textContent = answerAsk;
quizResult.textContent = answerResult;
quizConfirm.addEventListener("click", ()=>{
quizConfirm.style.display = "none"
quizResult.style.display= "block"
quizDog.classList.add("like");
})
>