Login Card

Report a typo

Most of the time when we visit a website, what really catches our attention is the design. This is why having some effects on the elements can make a difference.

With that in mind, let's create a card with an img and two buttons and add some nice effects to them.

These are the tasks you should complete for the img element:

  • Set a transition effect.

  • Give the transition a duration value between .1s and 2s, and a time-function.

  • When the mouse hovers over the image, make it scale by a value of 1.15.

These are the tasks you should complete for both button elements:

  • Give the transition two properties: opacity first and transform second.

  • For each property, set a transition duration value between .1 and 2s, and a time-function.

  • When the mouse hovers over the button, decrease the opacity to 70%.

  • When the mouse hovers over the button, make it scale by a value of 1.1.

The end result should look like this:

Image is scaled up on cursor hovering

Write HTML and CSS code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login Page</title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
</head>
<body>
<div class="main-container">
<div class="login-container">
<img class="user-avatar" src="https://upload.wikimedia.org/wikipedia/commons/9/99/Sample_User_Icon.png">
<button class="btn-login">Login</button>
<button class="btn-register">Register</button>
</div>
</div>
</body>
</html>
Completed 2 of 6
There's a <img> with a profile picture; The <img> has the correct transition values.
The Login and Register button has the correct transition properties.
___

Create a free account to access the full topic