복습 챌린지
Coddy HTML 여정의 CSS 마스터 섹션에 포함된 레슨. 43개 중 25번째.
챌린지
쉬움이 챌린지에서는 간단하지만 현대적인 느낌의 coffee shop 웹페이지를 만들어 봅니다. 지금까지 배운 모든 내용을 연습해 볼 기회입니다. 여기에는 gradient, CSS filter, transform, transition이 포함됩니다.
여러분의 과제는 다음을 완성하는 것입니다:
- hero section의 background에 linear gradient를 적용하세요. 원하는 색상을 사용해도 됩니다.
- hover할 때
transform: rotate(-3deg)를 사용하여 CTA button이 살짝 회전하도록 만들고, 부드러운 transition을 추가하세요. - 기본 상태의 coffee 이미지에 filter
sepia(60%)를 적용하세요. - hover할 때 coffee 이미지의 filter를
sepia(0%)로 변경하고,transform: scale(1.1)을 사용하여 이미지를 확대하세요.
직접 해보기
<html>
<head>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
text-align: center;
}
/* Hero Section with Gradient */
.hero {
padding: 80px 20px;
color: #3e2723;
}
.hero h1 {
font-size: 3rem;
margin-bottom: 10px;
}
.hero p {
font-size: 1.2rem;
margin-bottom: 20px;
}
.cta-btn {
background-color: #8d6e63;
color: white;
padding: 12px 24px;
border-radius: 8px;
font-size: 1rem;
}
/* Gallery section */
.gallery {
padding: 50px 20px;
background: #fffaf0;
}
.gallery h2 {
margin-bottom: 20px;
font-size: 2rem;
color: #4e342e;
}
.coffee-img {
max-width: 300px;
border-radius: 12px;
}
/*Add your CSS here */
</style>
</head>
<body>
<header class="hero">
<h1>Welcome to Coffee Bliss</h1>
<p>Your daily dose of joy in a cup</p>
<button class="cta-btn">Order Now</button>
</header>
<section class="gallery">
<h2>Our Signature Blend</h2>
<img src="https://images.unsplash.com/photo-1509042239860-f550ce710b93?auto=format&fit=crop&w=600&q=80" alt="Cup of Coffee" class="coffee-img" />
</section>
</body>
</html>
CSS 마스터의 모든 레슨
직접 연습해 보세요: Web 플레이그라운드