# What is the difference between cubic-bezier function and linear in css?

**URL:** <https://forum.freecodecamp.org/t/what-is-the-difference-between-cubic-bezier-function-and-linear-in-css/390566>\
**Category:** Curriculum Help\
**Tags:** css, html\
**Created:** [May 18, 2020, 10:54am UTC](https://forum.freecodecamp.org/t/what-is-the-difference-between-cubic-bezier-function-and-linear-in-css/390566 "2020-05-18T10:54:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![moshiurrahman92](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/moshiurrahman92/32/146153_2.png) [@moshiurrahman92](https://forum.freecodecamp.org/u/moshiurrahman92)\
**Post date:** [May 18, 2020, 10:54am UTC](https://forum.freecodecamp.org/t/what-is-the-difference-between-cubic-bezier-function-and-linear-in-css/390566/1 "2020-05-18T10:54:01Z")

</div>

**Tell us what’s happening:**  
I think **both are Same**..

`animation-timing-function: linear;`

`animation-timing-function: cubic-bezier(0,0,.58,.58)`

`animation-timing-function: cubic-bezier(0,0,.78,.78)`

_The three following examples are same._

…so why I will use cubic bezier function or curve..  
I noticed when I **changed the value of p2** then it d **oesn’t change at all** …  
And in the lessons I can’t understand what is the **x and y values?** I can’t get it…  
Though I somehow passed the challenge but I wanted to learn this properly..

**Your code so far**

```html

<style>
.balls{
  border-radius: 50%;
  position: fixed;
  width: 50px;
  height: 50px;
  margin-top: 50px;
  animation-name: bounce;
  animation-duration: 2s;
  animation-iteration-count: infinite;
}
#red {
  background: red;
  left: 27%;
  animation-timing-function: linear;
}
#blue {
  background: blue;
  left: 56%;
  animation-timing-function: ease-out;
  animation-timing-function: cubic-bezier(0,0,.58,.58)
}
@keyframes bounce {
  0% {
    top: 0px;
  }
  100% {
    top: 249px;
  }
}
</style>
<div class="balls" id= "red"></div>
<div class="balls" id= "blue"></div>

```

**Your browser information:**

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36`.

**Challenge:** Use a Bezier Curve to Move a Graphic

**Link to the challenge:**

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/responsive-web-design/applied-visual-design/use-a-bezier-curve-to-move-a-graphic)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![Roma](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/roma/32/112899_2.png) [@Roma](https://forum.freecodecamp.org/u/Roma)\
**Post date:** [May 18, 2020, 3:06pm UTC](https://forum.freecodecamp.org/t/what-is-the-difference-between-cubic-bezier-function-and-linear-in-css/390566/2 "2020-05-18T15:06:24Z")

</div>

This is one of the search for more information type questions. Perhaps this will help;  
[https://developer.mozilla.org/en-US/docs/Web/CSS/easing-function](https://developer.mozilla.org/en-US/docs/Web/CSS/easing-function)

You can Google for more information.

---

<div class="post-metadata">

**Author:** ![moshiurrahman92](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/moshiurrahman92/32/146153_2.png) [@moshiurrahman92](https://forum.freecodecamp.org/u/moshiurrahman92)\
**Post date:** [May 20, 2020, 2:28am UTC](https://forum.freecodecamp.org/t/what-is-the-difference-between-cubic-bezier-function-and-linear-in-css/390566/3 "2020-05-20T02:28:56Z")

</div>

@Roma Thanks 🙂  
I have been stuck with this thing a lot of time… your link gives me the proper details of it… now I know them; 🙃

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [May 31, 2021, 3:57pm UTC](https://forum.freecodecamp.org/t/what-is-the-difference-between-cubic-bezier-function-and-linear-in-css/390566/4 "2021-05-31T15:57:54Z")

</div>

Closed on May 31, 2021, 3:57pm UTC


