Flip cards are the cards in your website that will flip when you hover your mouse over them. There will be information, links or images in the back face of the card which will be visible when you hover over the cards.
In this article, you’re going to learn how to make Flip cards on your website using only HTML and CSS.
HTML file for card:
Decorating the front and back of the card using CSS: Built the structure of both faces of the card in the HTML part. Now we need to hide the back face initially. So we do that by backface-visibility: hidden property of CSS and this to the card-front and card-back classes so that when the front face is visible the back face is hidden and vice-versa. The key is to use the transform property of CSS and rotate the element by 180 degree i.e. transform: rotateY(180deg).
Note: You can rotate your cards as much as possible depending on the transform: rotateY(180deg). If you decrease the deg and increase the deg rotation is depending on that also you can flip the card vertically.
Example: This example uses transform: rotateY(180deg) property to flip/rotate the image. If you change the axis Y to X then cards will change the flip direction.
- How to create X and Y axis flip animation using HTML and CSS ?
- How to design Responsive card-deck with fixed width in Bootstrap ?
- Bulma | Card
- Display Content on hovering Card using CSS
- How to flip an image on hover using CSS ?
- HTML | <html> Tag
- HTML Course | Structure of an HTML Document
- HTML Course | Basics of HTML
- HTML | DOM HTML Object
- HTML | <html> xmlns Attribute
- What is the difference between <html lang="en'> and <html lang="en-US'> ?
- Inline HTML Helper - HTML Helpers in ASP.NET MVC
- Web technologies | HTML and XML | Question 1
- HTML | scoped Attribute
- HTML | DOM lang Property
- HTML | <section> Tag
- HTML | DOM Style backgroundClip Property
- HTML | DOM Style borderTop Property
- HTML | <th> valign Attribute
- HTML | <col> align Attribute
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.