Menu
Coddy logo textTech

復習チャレンジ

CoddyのHTMLジャーニー「CSSマスタリー」セクションの一部。レッスン 25/43。

challenge icon

チャレンジ

簡単

このチャレンジでは、シンプルでありながらモダンな見た目の coffee shop のウェブページを作成します。これまでに学んだことをすべて練習するチャンスです。gradient、CSS filter、transform、transitionなどが含まれます。

あなたの課題は、次の項目を完成させることです。

  1. linear gradientをhero sectionのbackgroundに適用します。色は自由に選べます。
  2. hover時に、CTA buttonをtransform: rotate(-3deg)で少し回転させ、滑らかなtransitionを追加します。
  3. coffee画像のデフォルト状態にfilter sepia(60%)を適用します。
  4. 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プレイグラウンド