Hello,
There are two questions I would like to ask:
I am trying to make a “+” icon turn into an “x” when clicked for rotation. In my understanding, it was necessary to implement the following: ‘rotate’ CSS code triggered on click; however, I have little experience with CSS, so I do not know how to execute it
I would like to have a picture on a div/card (?) become full text with a different background (like Apple). Could you please explain how to do it?
Example: macOS Ventura - Apple
I think I should be using ‘: hover’ or ‘: active’, but I cannot achieve this.
Basically, I would like to reproduce this type of work
Although it is relativily straightforwards to make, there is a bit involved, and understanding HTML and CSS is a a big help. You have to start with the right structure.
Main wrapping element.
Bottom element, which it transitions to.
Top element you start with.
The button that triggers the transition.
The main wrapper, you need to set a position of relative. The front and back a position of absolute so everything sits stacked.
The button needs to also be positioned and for it to call a javascript function, you can either do that inline, or with an event listener, which is what I would do if you were going to have multiples.
This function will make it all work. Many ways to do this, but the easiest… you could use the javascript to add a class to the main wrapping element, and then add CSS based on that class, for example adding a class called “.reveal”.