Day #3 of learning and posting
Day #3 of learning

Day #3 of learning and posting

Today I learned about transitions and transform properties;

In CSS (Cascading Style Sheets), the transition and transform properties are used to control the behavior of elements when it comes to animations and transformations. They are often used together to create smooth and visually appealing effects on web pages. Here's an overview of both properties:

  1. transition Property:

  • The transition property is used to specify how CSS property changes should be animated over time.
  • It allows you to define the transition effect for one or more CSS properties when they change values. These changes can be due to various events, such as hover, click, or state changes (e.g., when a button is pressed).
  • The transition property takes the following syntax:

transition: property duration timing-function delay;        
Article content

  • property: Specifies the CSS property you want to apply the transition to (e.g., color, width, opacity, etc.).
  • duration: Specifies the duration of the transition effect in seconds (e.g., 0.5s for half a second).
  • timing-function: Defines the timing function, which determines the acceleration and deceleration of the animation (e.g., ease, linear, ease-in, ease-out, etc.).
  • delay: Optionally, you can set a delay before the transition begins (e.g., 0.2s).Example:


/* Apply a transition to the color property over 0.5 seconds with ease-in-out timing */
transition: color 0.5s ease-in-out;        

2. transform Property:

  • The transform property is used to apply various 2D and 3D transformations to an element. It allows you to scale, rotate, translate, and skew elements without affecting the layout of the document.
  • It can be used to create visually appealing effects like animations and transitions.
  • The transform property can take multiple transform functions separated by spaces, and they will be applied in the order they appear.
  • Common transform functions include translate(), rotate(), scale(), skew(), and matrix(), among others.
  • Example:


/* Apply a rotation and a scaling transformation */
transform: rotate(45deg) scale(1.5);        
Debangi Choudhury

Senior Software Engineer | React, Next.js, Node.js, TypeScript, Tailwind, WebSockets | 4+ Years of Experience in Scalable Web Applications

1y

Really elaborate article. Loved it ❤️

Like
Reply

To view or add a comment, sign in

More articles by Pratik Kumar Jaiswal

  • Day 25 Learning In Public

    Day 25: Explored the power of React Query and utilized Tanstack to optimize data fetching and state management in React…

    1 Comment
  • Day 23 :Learning In Public

    "Unlocking React's Potential: A Deep Dive into the Callback Hook" Mastered the Callback Hook in React today, a powerful…

    1 Comment
  • Day #17 of Learning in Public

    In today's project, I unveiled "Marvel Assemble," a dynamic carousel webpage born from HTML, CSS, and JavaScript…

  • DAY #16 of Learning In Public

    Today's creative Endeavor resulted in : A tranquil meditation page crafted with HTML, CSS, and JavaScript. The soothing…

  • DAY #14 OF LEARNING IN PUBLIC

    Affordigo Day 14: Explored the CSS property, a pivotal tool in creating versatile, multi-line layouts within flex…

  • Day #13 of Learning In Public

    Day 13: Today's exploration led me to the intriguing realm of the CSS property. Discovering how to modify and animate…

    2 Comments
  • Day 12: Today, I delved into the fundamentals of setting up a project.

    Learning the essentials of project structuring, media queries, and responsive design principles has been pivotal. It's…

    2 Comments
  • Save your preloader spinner

    codepen link provided below Loader Spinner Follow me Pratik Kumar Jaiswal for more!!! 📈 🚀#html #css #javascript…

  • Day #10 of Learning In Public

    Day 10: Diving into the world of Sass, I harnessed the versatility of , , and properties to create dynamic layouts…

  • Day #9 of Learning in Public.

    A productive day exploring the power of in CSS for layering elements and mastering linear hover effects. These skills…

    1 Comment

Insights from the community

Others also viewed

Explore topics