Menu
Coddy logo textTech

Text Styling

Part of the Styling with CSS section of Coddy's HTML journey. Lesson 31 of 76.

challenge icon

Challenge

Easy

In this task, you will customize the font size, color, and decoration for different elements on the page. 

Follow the steps below:

  1. Set the font size of the <h1> element to 36px, and apply an underline decoration.
  2. Set the font weight of the element with the class welcome to 700.
  3. Set the font size of the <h2> elements (category titles) to 24px, font color to any color of your choice (not black).
  4. Set the font color of the elements with the class dish-name to any font color of your choice (not black).

Try it yourself

<html>
<head>
    <title>Café Menu</title>  
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <header>
        <h1>Café Delight</h1>
        <p class="welcome">Welcome to our café! Enjoy a delicious meal.</p>
    </header>
    <div class="menu-category">
        <h2>Appetizers</h2>
        <ul>
            <li>
                <p class="dish-name">Bruschetta $5.99</p>
            </li>
            <li>
                <p class="dish-name">Garlic Bread $3.50</p>
            </li>
        </ul>
    </div>
    <div class="menu-category">
        <h2>Main Courses</h2>
        <ul>
            <li>
                <p class="dish-name">Spaghetti Carbonara $12.99</p>
            </li>
            <li>
                <p class="dish-name">Grilled Chicken Salad $9.99</p>
            </li>
        </ul>
    </div>
    <div class="menu-category">
        <h2>Desserts</h2>
        <ul>
            <li>
                <p class="dish-name">Chocolate Cake $4.99</p>
            </li>
            <li>
                <p class="dish-name">Cheesecake $5.49</p>
            </li>
        </ul>
    </div>
    <footer>
        <p>&copy; 2025 Café Delight - All rights reserved</p>
    </footer>
</body>
</html>

All lessons in Styling with CSS

Practice on your own: Web playground