Open In App

CSS will-change property

Last Updated : 24 Jul, 2024
Summarize
Comments
Improve
Suggest changes
Share
Like Article
Like
Report

The will-change property is the replacement of animation in few cases, all the animation will look so jumpy a few times when the page took time to load. But in the case of will-change, those animated things will perform smoothly. 

Syntax:

will-change: auto | <animateable-feature>#

Property values:

  • auto: Here the developer should apply whatever heuristics and optimizations it normally does.
  • <animateable-feature>: Here the developer can define what kind of animation developer want to show.

Example: This example illustrates the will-change property. 

HTML
<!DOCTYPE html> 
<html> 
<head> 
	<title> 
		CSS | will-change property 
	</title> 
	<style> 
		h1 { 
			color: green; 
		} 
		.left{ 
			will-change: transform; 
			transition: 1s; 
		} 
		.left:hover { 
			transform: rotateX(45deg); 
		} 
	</style> 
</head> 
<body> 
	<center> 
		<h1>GeeksforGeeks</h1> 
		<h4>CSS | will-change property</h4> 
		<div> 
			<img class="left" src= 
"https://media.geeksforgeeks.org/wp-content/uploads/20190808102629/geeks15.png"
				alt="Sample image"> 
			<img class="right" src= 
"https://media.geeksforgeeks.org/wp-content/uploads/20190808102629/geeks15.png"
				alt="Sample image"> 
		</div> 
	</center> 
</body> 
</html>

Output:

Supported Browsers: The browsers supported by CSS will-change property are listed below:

  • Google Chrome 36+
  • Edge 79+
  • Firefox 36+
  • Safari 24+
  • Opera 9.1+

Similar Reads