Menu
Coddy logo textTech

Button Hover Effect

Part of the CSS Mastery section of Coddy's HTML journey — lesson 41 of 43.

challenge icon

Challenge

Easy

A button is already in the HTML. Your goal is to make it scale up slightly when the user hovers over it. In the CSS, style the .cta-button so that:

  • It has a smooth transition transition: transform 0.3s ease;.
  • On hover, it slightly increases in size using transform: scale(1.05).

Try it yourself

<html>
<head>
  <title>Button Hover Effect</title>
  <style> 
    
    /* Add your styles here */
      .cta-button {
      background-color: #6a1b9a;
      color: white;
      padding: 12px 24px;
      border: none;
      border-radius: 8px;
      font-size: 1rem;
    }

  </style>
</head>
<body>
    <button class="cta-button">Click Me</button>
</body>
</html>

All lessons in CSS Mastery