×

css · level 2 · unit 7 · lesson 2

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

Tap a green word if you get lost.

meet it

A sets the speed; a sets the start.

A transition can change speed as it goes. Its timing function is the speed curve: ease starts gently and slows at the end, linear keeps one steady speed, and ease-in-out is gentle at both ends.

A second time in the value is the delay, how long it waits before starting: .

opacity sets how solid something looks, from 0, invisible, to 1, fully solid. It is a favourite thing to transition.

<img class="photo" src="cat.svg" alt="A sleepy cat">
.photo {
  width: 160px;
  opacity: 0.6;
  transition: opacity 0.4s ease-in-out 0.1s;
}
.photo:hover {
  opacity: 1;
}

Press show my page to see it here.

Point at the photo: after a short wait it brightens to fully solid.