복습 챌린지
Coddy HTML 여정의 Practical Frontend 섹션에 포함된 레슨 — 35개 중 16번째.
챌린지
쉬움투자 및 경제적 자유에 관한 HTML 페이지가 제공됩니다. 여러분의 작업은 테마 설정에 대해 배운 내용을 사용하는 것입니다:
- 기본 및 보조 색상
:root에--primary-color와--secondary-color를 정의하세요.- header와 footer 배경에는
--primary-color를 사용하고, body 배경에는--secondary-color를 사용하세요.
- 다크 모드
- 배경, 텍스트 및 제목 색상을 변경하는
.dark-mode클래스를 만드세요. <body>에class="dark-mode"를 수동으로 추가하여 테스트하세요.
- 배경, 텍스트 및 제목 색상을 변경하는
- 강조 색상
--accent-color를 정의하고 이를 button의 background color와 footer link text color (rgb(249, 168, 37))에 사용하세요.
- 타이포그래피
--h1-size와--h2-size를 정의하고 제목에 적용하세요.
목표: 라이트 테마와 다크 테마 모두에서 페이지가 일관되고 전문적이며 읽기 쉽게 보이도록 만드세요.
직접 해보기
<!DOCTYPE html>
<html>
<head>
<title>Recap Challenge</title>
<style>
/* Theme variables */
:root {
--text-color: #333333;
--heading-color: #1a3a6d;
--primary-font: "Georgia", serif;
--secondary-font: "Arial", sans-serif;
}
body {
font-family: var(--primary-font);
color: var(--text-color);
margin: 0;
line-height: 1.6;
}
header {
color: white;
text-align: center;
padding: 2rem 1rem;
background-color: #000000;
}
h1 {
font-family: var(--secondary-font);
margin-bottom: 0.5rem;
}
h2 {
font-family: var(--secondary-font);
color: var(--heading-color);
}
main {
max-width: 800px;
margin: 2rem auto;
padding: 1rem;
}
section {
margin-bottom: 2rem;
background: #fff;
padding: 1.5rem;
border-radius: 8px;
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
ul li {
margin-bottom: 0.6rem;
}
button {
background-color: #000000;
color: white;
border: none;
padding: 0.75rem 1.5rem;
font-size: 1rem;
border-radius: 5px;
cursor: pointer;
transition: background 0.3s;
}
button:hover {
background: #c17900;
}
footer {
text-align: center;
padding: 1rem;
color: white;
background-color: #000000;
}
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<header>
<h1>Financial Freedom</h1>
<p>Smart habits for building wealth and living on your own terms.</p>
</header>
<main>
<section>
<h2>What is Financial Freedom?</h2>
<p>Financial freedom means having enough savings, investments, and cash on hand to afford the lifestyle you want, without worrying about money day-to-day.</p>
</section>
<section>
<h2>Timeless Investing Advice</h2>
<ul>
<li>Start early — the power of compounding works best with time.</li>
<li>Live below your means and save consistently.</li>
<li>Diversify your investments to reduce risk.</li>
<li>Stay patient — avoid emotional decisions during market ups and downs.</li>
</ul>
</section>
<section>
<h2>Money Mindset</h2>
<p>Money is less about numbers and more about behavior. Your mindset and habits matter more than chasing the highest returns.</p>
<button>Learn More</button>
</section>
</main>
<footer>
<p>More resources on <a href="#">Investing & Financial Freedom</a></p>
</footer>
</body>
</html>