Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make animations with CSS3
#1
Example:

<!DOCTYPE html>
<html>
<head>
  <title>Animations Example</title>
  <style>
    /* Define the animation keyframes */
    @keyframes slide-in {
      from {
        transform: translateX(-100%);
      }
      to {
        transform: translateX(0);
      }
    }
    /* Apply the animation to the div element */
    div {
      width: 200px;
      height: 100px;
      background-color: lightblue;
      animation: slide-in 1s ease;
    }
  </style>
</head>
<body>
  <div>This div slides in from the left.</div>
</body>
</html>

Explanation:

CSS animations are created using @keyframes to define the intermediate steps of the animation. In this example, the div element slides in from the left using the slide-in animation that lasts 1 second with an ease timing function.
Also follow me on Youtube for videos about video games:
https://www.youtube.com/channel/UCxfkGVU...2mQ/videos
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Advanced animations in CSS3 Qomplainerz 0 365 07-26-2023, 07:19 PM
Last Post: Qomplainerz
  How to make a grid layout with CSS3 Qomplainerz 0 290 07-26-2023, 07:03 PM
Last Post: Qomplainerz
  How to make a flexbox in CSS3 Qomplainerz 0 295 07-26-2023, 07:02 PM
Last Post: Qomplainerz
  How to make transitions with CSS3 Qomplainerz 0 321 07-26-2023, 06:59 PM
Last Post: Qomplainerz
  How to make shadows with CSS3 Qomplainerz 0 268 07-26-2023, 06:58 PM
Last Post: Qomplainerz
  How to make gradients with CSS3 Qomplainerz 0 259 07-26-2023, 06:57 PM
Last Post: Qomplainerz
  How to make rounded corners with CSS3 Qomplainerz 0 247 07-26-2023, 06:51 PM
Last Post: Qomplainerz

Forum Jump:


Users browsing this thread: 6 Guest(s)