
- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursors
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS Advanced
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Media Types
- CSS - Paged Media
- CSS - Aural Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS3 - Rounded Corner
- CSS3 - Border Images
- CSS3 - Multi Background
- CSS3 - Color
- CSS3 - Gradients
- CSS3 - Shadow
- CSS3 - Text
- CSS3 - Web font
- CSS3 - 2d transform
- CSS3 - 3d transform
- CSS3 - Animation
- CSS3 - Multi columns
- CSS3 - User Interface
- CSS3 - Box Sizing
- CSS Responsive
- CSS - Responsive Web Design
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
How to create a flip box with CSS?
To create a flip box with CSS, the code is as follows −
Example
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; margin:20px; } .flipCard { background-color: transparent; width: 300px; height: 300px; perspective: 1000px; } .innerCard { position: relative; width: 100%; height: 100%; text-align: center; transition: transform 0.6s; transform-style: preserve-3d; box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2); } .flipCard:hover .innerCard { transform: rotateY(180deg); } .frontCard, .cardBack { position: absolute; width: 100%; height: 100%; -webkit-backface-visibility: hidden; backface-visibility: hidden; } .frontCard { background-color: rgb(124, 225, 243); color: black; } .cardBack { background-color: #3329b9; color: white; transform: rotateY(180deg); font-size: 18px; font-weight: bold; } </style> </head> <body> <h1>Flip box example</h1> <div class="flipCard"> <div class="innerCard"> <div class="frontCard"> <h1>Front Text</h1> </div> <div class="cardBack"> <h1>Back Text</h1> </div> </div> </div> <h2>Hover over the above card to see the back side</h2> </body> </html>
Output
The above code will produce the following output −
On hovering above the element the element will flip as shown −
- Related Articles
- How to create a flip card with CSS?
- Create a transparent box with CSS
- How to create a Modal Box with CSS and JavaScript?
- How to Create a Comment Box with a Containing Text Using CSS
- How to create a full screen search box with CSS and JavaScript?
- Flip Effect with CSS
- How to create an accordion hover effect with box-shadows in CSS
- How to flip an image (add a mirror effect) with CSS?
- How to create a message box with Tkinter?
- Flip Animation Effect with CSS
- How To Create A Text Inside A Box Using HTML And CSS
- How to create and apply CSS to JavaScript Alert box?
- How to create a text input box with Pygame?
- How to create a pagination with CSS?
- How to create a Calendar with CSS?

Advertisements