CSS

CSS Overview Selectors Declarations Rule Sets Comments Reset/Normalize Origin Importance Order Specificity Inheritance Cascade Layers Inline Styles Internal Styles External Styles @import Absolute Units Relative Units Dynamic Viewport Angle Units Time Units Frequency Units: Resolution Units Keywords Color Formats Color Functions & Spaces Background Color Background Image Background Repeat Background Position Background Size Background Attachment Background Shorthand Multiple Backgrounds Linear Gradients Radial Gradients Conic Gradients Font Family Font Size Font Weight Font Style Line Height Text Align Text Decoration Text Transform Letter Spacing Word Spacing Text Shadow Text Wrap Variable Fonts Content Box Padding Box Border Box Margin Box Box Sizing Property Margin Padding Border Outline Box Shadow Block Display Inline Display Inline Block Display Static Position Relative Position Absolute Position Fixed Position Sticky Position Top Element Position Right Element Position Bottom Element Position Left Element Position Z Index Flexbox Box Layout Display Flex Flex Direction Flex Wrap Justify Content Align Items Align Content Gap, Row Gap & Column Gap Flex Grow Flex Shrink Flex Basis Flex Shorthand Order Property Align Self Practical Applications CSS Grid Layout Grid Display Grid Template Columns Grid Template Rows Grid Template Areas Justify Items Grid Auto Columns Justify Self Nested Grids Responsive Web Design Min Width Max Width Orientation Logical Operators Pointer Hover Prefers Color Scheme Fluid Images Flexible Typography Viewport Width Advanced CSS Features Defining variables Using variables Scope & Inheritance of CSS Variables Property Value Fallback Practical Applications :Hover :Active :Focus :Focus Visible :Visited :Link :First Child :Last Child :Nth Child :Nth of Type :Empty :Checked :Disabled :Enabled :Valid :Invalid :Required :Has :Not :Is :Where ::Before Pseudo Element ::After Pseudo Element ::First Letter ::First Line ::Selection ::Marker CSS 2D Transformations CSS 3D Transformations Transform Origin Transform Style Backface Visibility Transition Property Transition Duration Transition Timing Function Transition Delay Transition Shorthand Ease Timing Function Linear Timing Function Ease In Timing Function Ease Out Timing Function Ease In Out Timing Function Cubic Bezier Function Animations (@keyframes) Defining @keyframes Animation Name CSS Animation Duration Animation Timing Function CSS Animation Delay CSS Animation Iteration Count Animations Direction CSS Animation Fill Mode CSS Animation Play State CSS Filter Blur CSS Filter Brightness CSS Filter Contrast() CSS Drop Shadow CSS Grayscale CSS Hue Rotate CSS Invert CSS Opacity CSS Saturate CSS Sepia Mix Blend Mode Background Blend Mode Object Fit & Object Position Scroll Snap Type Scroll Snap Align Scroll Padding Scroll Margin Scroll Triggered Animations JS Variables

Ease Out Timing Function


The ease-out timing function is a value for the transition-timing-function and animation-timing-function properties in CSS. It dictates that a transition or animation starts at a fast pace and then gradually decelerates to a complete stop, creating a smooth and natural-looking effect. This is often used for elements that are coming into view or finishing a movement.


Example 1: Width Transition

/* This example demonstrates the ease-out timing function on the width property. */
.box-width {
  width: 100px;
  height: 100px;
  background-color: #3498db;
  transition: width 2s ease-out; /* The transition will take 2 seconds and use the ease-out function. */
}

.box-width:hover {
  width: 300px; /* The width will expand on hover. */
}

Explanation

When you hover over the .box-width element, its width animates from 100px to 300px over two seconds. The ease-out function causes the expansion to start quickly and then slow down as it reaches its final width, providing a fluid visual effect.


Example 2: Opacity Fade-In

/* This example shows the ease-out timing function applied to the opacity property. */
.fade-in {
  opacity: 0;
  transition: opacity 1.5s ease-out; /* The opacity transition will last 1.5 seconds with ease-out. */
}

.container:hover .fade-in {
  opacity: 1; /* The element will become fully visible on hover of its container. */
}

Explanation

In this code, the .fade-in element is initially invisible. When its container is hovered, it fades in to full opacity over 1.5 seconds, starting the transition rapidly and then gently finishing.


Example 3: Margin-Left Movement

/* This example uses the ease-out timing function to animate the margin-left property. */
.slide-right {
  margin-left: 0;
  transition: margin-left 1s ease-out; /* The margin-left property will transition for 1 second with ease-out. */
}

.slide-right:hover {
  margin-left: 150px; /* The element will move to the right on hover. */
}

Explanation

Hovering over the .slide-right element causes it to move 150 pixels to the right. The ease-out timing makes the initial movement fast, with a gradual slowdown as it reaches its new position.


Example 4: Font-Size Growth

/* This example applies the ease-out timing function to the font-size property. */
.text-grow {
  font-size: 16px;
  transition: font-size 0.8s ease-out; /* Font-size will transition for 0.8 seconds with ease-out. */
}

.text-grow:hover {
  font-size: 32px; /* The font size will double on hover. */
}

Explanation

When hovered, the font size of the .text-grow element doubles. The ease-out function ensures that the text grows quickly at first and then smoothly settles into its larger size.


Example 5: Transform Scale

/* This example demonstrates the ease-out timing function with the transform: scale() property. */
.scale-up {
  transition: transform 1.2s ease-out; /* The transform property will transition for 1.2 seconds with ease-out. */
}

.scale-up:hover {
  transform: scale(1.5); /* The element will scale up by 50% on hover. */
}

Explanation

This code scales the .scale-up element to 1.5 times its original size on hover. The ease-out function provides a dynamic effect where the scaling is initially rapid and then slows down as it reaches the final size.