Overview
Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn to create an engaging cursor-following effect using pure CSS in this 26-minute tutorial. Start with basic HTML setup and progress through adding pseudo-elements to create bubble effects that track cursor movement. Explore CSS anchor positioning techniques, including common pitfalls and solutions when working with relative positioning. Master the use of calc() functions with anchor() values to create precise positioning calculations. Discover how to properly manage element stacking order and enhance animations with custom shapes and easing functions. Conclude by implementing an advanced cutout effect that adds visual depth to the cursor follower. Access the complete CodePen example, additional resources on CSS corner shapes, anchor positioning polyfills, and easing tools to extend your learning beyond the tutorial.
Syllabus
00:00 - Introduction
00:37 - Basic setup
02:18 - Adding the pseudo-element for the “bubble”
03:30 - My first failed attempt at using anchor positioning
08:12 - How you can animate the anchor position between elements
10:20 - Be careful with position relative and anchor positioning
13:40 - Using calc with anchor
16:50 - Fixing the stacking of elements
17:45 - Improving the animation and shapes
20:16 - The cutout effect
Taught by
Kevin Powell