University of New Hampshire, Department of Computer Science

Information Technology 502
, Intermediate Web Design

Spring 2024

Jump to navigation

Design Template by Anonymous

Introduction

What are CSS Transitions?

Transitions in CSS allow you to change between two states smoothly over a duration of time. By using transitions, we can make buttons or dropdowns, for example, feel fluid and less abrupt when moused over or clicked on.

How do they differ from Animations and Transforms?

There are two ways we can implement movement on elements with CSS. Transitions are one way we can do this, and animations are the other way. It’s important to know the difference between these two! It’s important to note that transitions are animations, but animations themselves are much more complex than transitions.Tranforms are often brought up when talking about transitions and animations, because they can be used together with transitions and animations to further enhance our websites.

Why use Transitions?

Transitions can help bring life and interest to a webpage. They can help the user feel engaged and can make a site feel more professional and thought–out. When changes within a site are abrupt and harsh, the user might notice and pick up on this and it might determine whether or not that user remains on your website. Users tend to notice errors rather than working pages, so a site that is working, polished, and has well–transitioned elements is the goal here.

One of the bigger reasons to use transitions is to show the user that their action has taken effect. For example, in a navigation bar, if a user hovers over the "About Us" page button, it might change colors to indicate that they can click on it. When they click on it, it might stay the color that it was when they hovered over it to show that they are now on that page. It’s this kind of seamlessness and continuity that will help bring a site together and make the browsing experience better for the user.