Flip Card CSS vs a Flip Box Widget: Which One to Use in WordPress

A CSS flip card flipped to its back face next to a Flipbox widget card

Key Takeaways

  • A flip card CSS snippet works once three properties are in place: perspective on the outer container, transform-style: preserve-3d on the inner wrapper, and backface-visibility: hidden on both faces.
  • The complete flip card CSS in this post is 40 lines plus 13 lines of HTML, and it runs in a Custom HTML block or an Elementor HTML widget with no plugin installed.
  • A CSS flip card flips on :hover, which MDN describes as unreliable on touch screens, so a phone needs a JavaScript class toggle or a (hover: none) fallback before the back face is reachable.
  • Elementor’s per-element Custom CSS field is an Elementor Pro feature and is missing from the $60 a year Essential plan, so most people keep the flip card CSS in a style tag inside the HTML widget.
  • The Master Addons Flipbox widget builds the same card from the Elementor panel with 6 included animations, 22 with Master Addons Pro, a Flip Box Height field and an action button on the back face.
  • Both routes flip on hover only on desktop; the CSS version gains a click trigger with a short JavaScript snippet, and the Flipbox widget flips on the first tap on touch screens.

A flip card CSS snippet is about 40 lines long and works in any WordPress theme, with or without a page builder. You put perspective on the outer box, preserve-3d on the inner wrapper, hide the back of each face, and rotate the wrapper 180 degrees on hover. The Flipbox widget from Master Addons builds the same two-face card from the Elementor panel. Both work. Which one suits you depends on how many cards you have, who edits them later and whether your visitors are on phones.

Below you’ll find the full CSS version with each part explained, where the code goes in WordPress and what breaks on a live site. After that comes the widget route with screenshots, then a comparison table and a short decision list.

The CSS flip card in about 40 lines

The effect comes down to two faces stacked in the same box, the back one turned 180 degrees and hidden, plus a hover rule that rotates the stack. Paste the markup and the CSS below into one place and you have the left-hand card from the screenshots further down.

<!-- HTML -->
<div class="flip-card">
  <div class="flip-card-inner">
    <div class="flip-card-front">
      <h3>CSS flip card</h3>
      <p>About 40 lines of CSS in an HTML widget.</p>
    </div>
    <div class="flip-card-back">
      <h3>Back face</h3>
      <p>Rotated 180deg and hidden until hover.</p>
      <a href="/services/">Learn more</a>
    </div>
  </div>
</div>

The outer div is the card and sets the size and the perspective. The inner div is the part that rotates, and the two face divs sit on top of each other inside it. The link on the back is optional; the W3Schools flip card how-to has text on the back and no button.

/* CSS */
.flip-card {
  width: 300px;
  height: 220px;
  perspective: 1000px;
}
.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}
.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}
.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-radius: 14px;
  text-align: center;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.flip-card-front {
  background: #ffffff;
  color: #1e1b4b;
  border: 1px solid #e5e7eb;
}
.flip-card-back {
  background: #4f46e5;
  color: #ffffff;
  transform: rotateY(180deg);
}

The .flip-card rule gives the card a fixed width and height, because the faces are positioned absolutely and cannot size the card themselves. The perspective value is the distance between the viewer and the card: W3Schools uses 1000px, and a lower number such as 800px makes the turn look deeper. Without it the card squashes flat in the middle of the turn.

The .flip-card-inner rule is the wrapper that turns. It is relative so the faces can be placed inside it, and it fills the card. The transition animates the turn, and 0.8 seconds is the W3Schools default. The transform-style: preserve-3d line keeps the two children in 3D space while the wrapper rotates. If you leave it out, the browser flattens the children and the back face shows through the front as a mirrored mess.

The hover rule rotates the wrapper 180 degrees around the Y axis, which is a horizontal flip. Swap rotateY for rotateX here and in the back-face rule for a vertical flip. That hover rule is the only trigger in the snippet, and the next section explains why that causes trouble.

The two face rules are absolute, fill the wrapper with inset: 0, and center their content with flexbox. The backface-visibility property on MDN has two values, visible and hidden, and hidden means the browser does not draw a face once it has turned away from you. MDN lists it as widely available since March 2022; the -webkit- prefix stays in for Safari, which still ignores the unprefixed version on some layouts.

The back face starts out rotated 180 degrees, so it faces away from the viewer and is hidden. When the wrapper turns on hover, the back ends up at 360 degrees, facing you, while the front is now turned away and hidden.

How to add the CSS flip card in WordPress

Any place in WordPress that accepts raw HTML takes the card; the CSS sits next to it or in a site-wide CSS field.

The Custom HTML block

In the block editor, add a Custom HTML block, paste the HTML from above, and put the CSS inside a style tag in the same block, above the markup. A self-hosted WordPress site keeps the style tag as typed. The WordPress.com support page for the block notes that the free WordPress.com plan strips style tags, so on that plan the CSS has to go into the Customizer.

The Elementor HTML widget

Free Elementor includes an HTML widget. Drag it into a container, paste the style tag and the HTML together, and the card renders in the editor preview. That is how the left-hand card in the screenshots below was made. Each HTML widget is its own copy, so three cards means three copies of the snippet unless the CSS moves somewhere shared.

Where the CSS can live instead

Appearance > Customize > Additional CSS applies to the whole site, so the HTML widgets then carry markup only. On a block theme the Customizer is hidden unless a plugin brings it back, so the style tag in the block is simpler there. Elementor’s own Custom CSS field, under Advanced > Custom CSS on any element, is an Elementor Pro feature, and the Elementor Custom CSS help page says it is not available in the Essential plan, the $60 a year tier we checked on 29 Oct 2026. The Master Addons Custom CSS extension adds the same kind of field to the Advanced tab of every widget with no Elementor Pro needed, scoped to that widget’s selector.

Keep the flip-card- prefix on the class names. A theme that already styles .card or .inner collides with shorter names, and the collision shows up as a card that never flips.

What breaks with the CSS version

Five issues come up every time this snippet goes on a live site. All five can be fixed, though every fix adds code to the 40 lines you started with.

Touch screens have no hover

The snippet flips on :hover, and a phone has no pointer to hover with. MDN’s note on the :hover pseudo-class says it “might never match, match only for a moment after touching an element, or continue to match even after the user has stopped touching”, which matches what you see in practice: on some phones the first tap flips the card and it sticks, and on others nothing happens.

Add :focus-within next to the hover rule and give the card a tabindex, so a keyboard user who tabs to the back-face link brings the card round. Then toggle a class on tap with JavaScript and wrap the hover rule in a (hover: hover) media query so the two do not fight on touch screens.

/* CSS: replace the hover rule with this */
@media (hover: hover) {
  .flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
  }
}
.flip-card:focus-within .flip-card-inner,
.flip-card.is-flipped .flip-card-inner {
  transform: rotateY(180deg);
}
// JavaScript: tap or click toggles the card
document.querySelectorAll('.flip-card').forEach(function (card) {
  card.setAttribute('tabindex', '0');
  card.addEventListener('click', function (event) {
    if (event.target.closest('a')) { return; } // let the back-face link work
    card.classList.toggle('is-flipped');
  });
});

The script goes in a script tag under the HTML in the same block or widget. Without the closest(‘a’) check, a tap on Learn more flips the card back before the link opens.

The height is fixed

Because both faces are absolute, the card cannot grow to fit its text. The height on .flip-card is the height of both faces, so a back face with three paragraphs overflows a card sized for the front. W3Schools fixes its card at 300 by 200 pixels, David Walsh at 320 by 480, and the comments on his post name that as the main complaint. Pick a height that fits the longer face and keep the back text short. On narrow screens a (hover: none) media query can also put the faces back into normal flow and stack them.

Safari and the backface

WebKit is where this effect misbehaves most. The CSS-Tricks almanac entry for backface-visibility marks its own demo as problematic in WebKit, and its comments report the back face showing through and iOS content vanishing on scroll. The usual fixes are the -webkit- prefix (already in the snippet), translateZ(1px) on the back face, and putting overflow rules on the faces instead of the parents. A backdrop-filter: blur on a face also breaks backface-visibility: hidden in Safari, which is WebKit bug 249952.

This next trap isn’t limited to Safari. Any ancestor with overflow: hidden, an opacity below 1, a filter, or will-change: transform flattens preserve-3d, and the card stops flipping in 3D. Elementor containers often carry overflow: hidden from the Advanced tab, so if the card squashes flat inside a container, check that setting first.

The hidden back face is only hidden visually

Screen readers read the back face in source order whether or not it is rotated away, so both faces come out as one run of text. Keyboard users can tab to the Learn more link on the back while the card still shows the front, so keep the :focus-within rule even on a desktop-only site. A prefers-reduced-motion media query that sets the transition to none lets the card snap instead of turning for visitors who asked for less motion.

Every change is a code edit

A new color, a shorter heading or a different link means opening the HTML widget and editing the snippet, in each widget if the CSS is not shared. For one card you maintain yourself, that’s fine. On a services page with six cards that a client edits, every wording change turns into a support ticket.

The Flipbox widget route

The Flipbox widget in Master Addons builds the same two-face card from the Elementor panel, with no Elementor Pro needed. Search for Flipbox in the widget panel, drag it in, and fill the fields. The Content tab has four sections: Style Preset, Front Box, Back Box and Action Button.

Style Preset holds two dropdowns. Design Variation sets the front layout: Default and Front Icon come with the widget, and Front Image and Diagonal need Master Addons Pro. Front Icon shows only the icon on the front, with the title and text on the back. Animation Style is the flip itself. Flip Horizontal, Flip Vertical, Fade, Flip Box, Flip Box Fade and Fade Up are included; Master Addons Pro adds 16 more, including four Cube directions, Rollover and 3D Flip with its own direction control, for 22 in total.

Elementor editor with the Master Addons Flipbox widget selected, Style Preset section open showing Design Variation set to Default and Animation Style set to Flip Vertical, with two framed-icon cards titled Design and Development in the preview
Style Preset: Design Variation and Animation Style are the two dropdowns that replace the hover rule and the face layout from the CSS version.

Front Box turns the snippet’s front face into fields. Icon Style has Default, Stacked and Framed, with a Circle or Square shape for the last two; then the icon or image, the Title, the Description, the Alignment and a Title HTML Tag dropdown. Back Box repeats the same fields plus a View control. Action Button takes the Button Text and the link, and it is the only link in the widget.

Front Box section of the Master Addons Flipbox widget with Icon Style Framed, Shape Circle, a pen and ruler icon, Title Design, Description Brand UI and print, center Alignment and Title HTML Tag H3, next to the Flipbox Lab preview
Front Box: the icon, title, description and heading tag that the CSS version keeps in markup are plain fields here.

The Style tab opens with a General section: Box Border, Border Radius and Flip Box Height. Flip Box Height answers the fixed-height problem: the widget still needs a height so both faces stay the same size (the placeholder is 250), but you set it once and both faces follow. Set it before you publish; if the back face has more text than the front and the field is empty, the card resizes mid flip. Front Box, Back Box and Button sections below it handle colors, typography and the button’s Normal and Hover states.

Style tab of the Master Addons Flipbox widget, General section showing Border Type None, Border Radius 14 on all sides and Flip Box Height 280, with collapsed Front Box, Back Box, Action Button and Patterns sections below
Style, General: Flip Box Height keeps both faces the same size, which the CSS version does with a hard-coded height on the card.

The widget has two limits of its own. It flips on hover, the same as the CSS version, with no click trigger on desktop; on touch screens the first tap flips the card and the button needs a second tap. And the Action Button is the only link, so to make the whole card clickable you turn on the Wrapper Link extension on the widget and give it the URL.

On the lab page the left card is the CSS snippet inside an HTML widget and the right card is the Flipbox widget with the Front Icon design.

Two cards side by side on a light page under the heading Flip card CSS or the Flipbox widget: a white hand-written CSS flip card on the left and a Master Addons Flipbox widget card with a framed cube icon on the right, both showing their front faces
Front faces: the hand-written CSS card in an HTML widget on the left, the Flipbox widget on the right.
The same two cards with the CSS flip card on the left flipped to its purple back face reading Back face, rotated 180deg and hidden until hover, with a white Learn more button, next to the unflipped Flipbox widget card
The CSS card on hover: the purple back face with the Learn more link, built from the snippet above.
Three Master Addons Flipbox cards under the heading What we do, with the middle card flipped to a pink back face showing an arrow icon, the title Build team, a short description and an Our stack button, while the Design and Marketing cards show their framed-icon front faces
The Flipbox widget on hover: the middle card turns to its back face with the Action Button, with no code in the page.

Want to see the 22 animations before you decide? The Flipbox widget page has 20 live demos grouped by animation, each one named so you can rebuild it from the panel.

The Flipbox documentation goes through every field in the Content and Style tabs.

CSS flip card vs flip box widget

On screen the two routes look the same. Where they differ is the work of building the card and keeping it up to date.

FactorCSS flip cardFlipbox widget
Setup timePaste 13 lines of HTML and about 40 lines of CSS, then adjust size and colors by hand; 10 to 15 minutes for the first cardDrag in the widget, fill the Front Box, Back Box and Action Button fields; a couple of minutes per card
Touch screens:hover is unreliable; add the JavaScript toggle and a (hover: hover) wrapperFirst tap flips the card, second tap hits the button, handled by the widget
Height handlingHard-coded height on .flip-card; a long back face overflowsFlip Box Height field in Style, General keeps both faces the same size
AnimationsOne: the rotateY or rotateX you write; any other effect is new transforms6 included (Flip Horizontal, Flip Vertical, Fade, Flip Box, Flip Box Fade, Fade Up), 22 with Master Addons Pro
Editing laterEdit the code in each HTML widget, or in Additional CSS plus each widget’s markupChange text, icon, colors and animation in the panel per card
Whole-card linkWrap the card in an a tag or handle it in the JavaScriptAction Button only; the Wrapper Link extension makes the whole card clickable
CostNothing beyond your time; Elementor’s per-element Custom CSS field needs an Elementor Pro plan above EssentialThe Master Addons plugin; Front Image, Diagonal and 16 animations need Master Addons Pro
Where it worksAny theme, the block editor, the Elementor HTML widget, page builders with an HTML blockElementor pages and templates, with Master Addons installed

Which one should you use

Decide by the number of cards and by who edits them. The CSS route gives you more control and works on sites without Elementor, while the widget is faster to build and easier for a non-developer to maintain.

Pick the CSS flip card when:

  • You have one or two cards on a page you maintain yourself and are happy editing HTML in a block.
  • The site does not run Elementor, or you want the card in a theme template or a block pattern where a widget cannot go.
  • You need a click trigger on desktop, which the JavaScript toggle above gives you and the Flipbox widget does not.
  • You want no extra plugins and will test on an iPhone before launch.

Pick the Flipbox widget when:

  • You are building a grid of three or more cards that should match without copied code.
  • Someone else will change the text, icons or links later and should never see a line of CSS.
  • You want a different animation per section, or Cube, Rollover and 3D Flip, without writing transforms.
  • Touch behavior and the shared face height should work on day one.

A developer can also prototype one card in CSS, then rebuild the grid with the widget so the client can edit it. If the reveal has to happen on click in Elementor without any JavaScript, the Toggle Content widget fits better than either flip card, and a card that never needs a back face is an Info Box job.

Frequently asked questions

Can I make a flip card in WordPress without a plugin?

Yes. Paste the 13 lines of HTML and about 40 lines of CSS from this post into a Custom HTML block, with the CSS inside a style tag above the markup. It needs perspective, transform-style: preserve-3d and backface-visibility: hidden, flips on hover, and takes the short JavaScript toggle for phones.

Why does my CSS flip card not work on mobile?

Because the flip runs on :hover and a touch screen has no hover state. MDN notes that :hover on touch devices may never match, match for a moment, or stay matched after the finger lifts. Toggle a class on tap with JavaScript, wrap the hover rule in a (hover: hover) media query, or use a (hover: none) query to stack both faces on small screens.

How do I make a flip card flip on click?

For the CSS card, add a click listener that toggles an is-flipped class on the card and style .flip-card.is-flipped .flip-card-inner with the same rotateY(180deg) as the hover rule; the snippet in this post does that. The Master Addons Flipbox widget is hover only on desktop and flips on the first tap on touch screens; it has no click trigger.

Does Elementor have a flip card widget?

Only in Elementor Pro. The Elementor Pro Flip Box widget has six effects (Flip, Slide, Push, Zoom In, Zoom Out, Fade), a 3D Depth toggle and a whole-box link option, and it sits in every Pro plan from Essential upward. Free Elementor has no flip box, so without Pro you paste the CSS into the HTML widget or add a widget from an addon such as Master Addons.

Final thoughts

A flip card CSS snippet is three properties and a hover rule, and it’s worth knowing because every flip box widget does the same thing underneath. For one card on a page you control, paste the 40 lines and the touch fix and move on. If a client edits the grid, or you want Cube, 3D Flip, a height field and tap handling with no script tag, the Flipbox widget does it all from the panel and keeps the code out of the page. Both routes are hover only on desktop, so if a click trigger is the deciding factor, the CSS route with the JavaScript toggle is the one to take.

Picture of Roy Jemee
Roy Jemee
I'm Roy Jemee, Content Wrangler and Marketer at Pixar Labs, working on Master Addons for Elementor. I write the tutorials, record the videos, and keep the documentation current, so you always know how to use every feature. I also handle support, so if you hit a snag, I'm the person who helps you fix it. Real answers, from someone who uses these tools every day.

Leave a Reply

Your email address will not be published. Required fields are marked *