Design a Carousel Column Expansion Animation Effect on Hover using CSS
In this article, we will see how to create the Carousel column expansion animation on a hover using CSS. Carousel Column expansion animation is a kind of reveal animation in the modern web design paradigm. To accomplish this task, we will create 3 columns of specific width and height, and on mouse hover, the animation is as such that the column on which the mouse pointer points will expand and the content is revealed. The text content is initially downward facing, which is rotated 90 degrees to the left, on mouse hover, the text content will be rotated to the normal 0-degree angle.
- Create the class container with the class name card.
- Add the child elements, <p> & <span> for creating three-column elements, with text inside it.
- In order to style the card, we have used the border-radius property & display property as flex for changing the shape, shrink-expand, gap, and padding.
- Now, we will use the transition property for the inner elements, which specifies the CSS properties to which a transition effect should be applied, along with implementing an overflow property that controls the big content & tells whether to clip content or to add scroll bars.
- By styling the <p> element inside the card with the hover state, increases the flex size for the expansion of the column.
- For text rotation, we will use the transform property that specifies changing the coordinate space of the visual formatting model. Here, the transform property will rotate the text to 90 degrees anticlockwise direction. On hovering, we will make the transform rotate to 0 degrees. In other words, including the hover state style will add the transform rotation to negative 90 degrees and transition duration to a half second.
Example: This example describes the creation of the Carousel column expansion animation on hover using CSS.
My Personal Notes arrow_drop_up
Please Login to comment...