Summary of Css Grid
Summary of Css Grid
4o
You said:
animation in css
ChatGPT said:
CSS animations allow elements to transition between states smoothly using keyframes. They provide a
more efficient and performant alternative to JavaScript-based animations.
✅ Basic Example
css
CopyEdit
@keyframes slideRight {
from {
transform: translateX(0);
}
to {
transform: translateX(100px);
.box {
width: 100px;
height: 100px;
background-color: steelblue;
✔ The element moves 100px to the right in 2 seconds and loops infinitely.
🔹 2. @keyframes Rule
css
CopyEdit
@keyframes fadeIn {
from {
opacity: 0;
to {
opacity: 1;
}
css
CopyEdit
@keyframes bounce {
0% { transform: translateY(0); }
🔹 3. animation Property
css
CopyEdit
css
CopyEdit
@keyframes fadeEffect {
0% { opacity: 0; }
100% { opacity: 1; }
.box {
✅ B. Bounce Effect
css
CopyEdit
@keyframes bounce {
}
.box {
✅ C. Rotating Animation
css
CopyEdit
@keyframes rotate360 {
to { transform: rotate(360deg); }
.box {
css
CopyEdit
@keyframes circularMotion {
}
.box {
Value Description
css
CopyEdit
css
CopyEdit
.box:hover {
animation-play-state: paused;
}
css
CopyEdit
.box {
animation: none;
.box:hover {
🔹 7. Multiple Animations
✅ Example
css
CopyEdit
.box {
🎯 Summary
4o
You said:
transitions in css
ChatGPT said:
CSS Transitions allow smooth changes between property values over a duration instead of instantly
applying them. They enhance user experience without requiring JavaScript.
css
CopyEdit
transition-property Specifies the CSS property to animate all, background, opacity, transform, etc.
CopyEdit
.box {
width: 100px;
height: 100px;
background-color: steelblue;
.box:hover {
background-color: crimson;
css
CopyEdit
.box {
width: 100px;
height: 100px;
background-color: steelblue;
transform: scale(1);
}
.box:hover {
background-color: crimson;
transform: scale(1.2);
Value Description
css
CopyEdit
.box {
🔹 5. Transition Delay
css
CopyEdit
.box {
css
CopyEdit
.box {
.box:hover {
transform: scale(1.2);
css
CopyEdit
.box {
.box:hover {
transform: rotate(45deg);
css
CopyEdit
.box {
opacity: 0.5;
.box:hover {
opacity: 1;
css
CopyEdit
.button {
background-color: steelblue;
color: white;
border: none;
.button:hover {
background-color: darkblue;
.button:active {
transform: scale(0.9);
css
CopyEdit
.box {
🎯 Summary
4o
You said:
transform in css
ChatGPT said:
The CSS transform property allows you to modify elements by rotating, scaling, translating, or skewing
them without affecting surrounding elements.
🔹 1. Basic Syntax
css
CopyEdit
transform: function(value);
css
CopyEdit
css
CopyEdit
.box {
Function Description
🔹 3. Rotate (Spin)
css
CopyEdit
.box {
Function Description
🔹 4. Scale (Resize)
css
CopyEdit
.box {
Function Description
🔹 5. Skew (Tilt)
Tilts an element.
css
CopyEdit
.box {
Function Description
🔹 6. Multiple Transformations
css
CopyEdit
.box {
🔹 7. transform-origin
css
CopyEdit
.box {
transform: rotate(45deg);
✅ Example: 3D Rotation
css
CopyEdit
.box {
transform: rotateY(45deg);
transform-style: preserve-3d;
🎯 Summary
4o
You said:
3d transformatnio
ChatGPT said:
Before applying 3D transformations, you need to set a perspective to control the depth effect.
css
CopyEdit
.container {
✔ Elements closer to the screen appear larger, and those farther appear smaller.
✅ Example: Move in 3D
css
CopyEdit
.box {
Function Description
css
CopyEdit
.box {
transform: rotateX(45deg);
transform: rotateY(30deg);
transform: rotateZ(60deg);
Function Description
🔹 4. scale3d() – Resize in 3D
✅ Example: Scale in 3D
css
CopyEdit
.box {
Function Description
🔹 5. transform-style: preserve-3d;
css
CopyEdit
.container {
perspective: 600px;
transform-style: preserve-3d;
css
CopyEdit
.container {
}
Value Effect
css
CopyEdit
.box {
backface-visibility: hidden;
css
CopyEdit
.container {
perspective: 800px;
.card {
width: 200px;
height: 300px;
position: relative;
transform-style: preserve-3d;
.card:hover {
transform: rotateY(180deg);
.front, .back {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
.back {
transform: rotateY(180deg);
🎯 Summary