Safari not functioning properly with CSS flip card and link combo

I am looking to create a CSS flip card that rotates in 3D on mouse hover, similar to the one showcased on W3Schools. My main requirement is to have a clickable link on the back side of the card.

While there are no issues with the latest versions of Chrome or Firefox, I have encountered an issue in Safari (Version 17.0), where only the right-hand side of the link is clickable.

https://i.sstatic.net/Jo8e0.pnghttps://i.sstatic.net/L3y5u.png

Here's a code example: https://jsfiddle.net/poooow/oe3b0swq/

.flip-card {
  background-color: transparent;
  width: 150px;
  height: 150px;
  perspective: 1000px;
}

.flip-card-inner {
  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);
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.flip-card-front {
  background-color: #408abf;
  color: white;
}

.flip-card-back {
  background-color: #66bf40;
  color: white;
  transform: rotateY(180deg);
}
<h3>Hover over the image below:</h3>
<div class="flip-card">
  <div class="flip-card-inner">
    <div class="flip-card-front">
      <h1>Front</h1>
    </div>
    <div class="flip-card-back">
      <h1>Back</h1>
      <a href="#">This link doesn't work in Safari</a>
    </div>
  </div>
</div>

Answer №1

After some trial and error, I managed to resolve the issue by rotating the individual card sides (.flip-card-front and .flip-card-back) instead of the entire container (.flip-card-inner).

To clarify, in this particular case, the code should be changed from:

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

To:

.flip-card-inner:hover .flip-card-front {
    transform: rotateY(180deg);
}

.flip-card-inner:hover .flip-card-back {
    transform: rotateY(0deg);
}

I also made adjustments by moving the transition and box-shadow properties to the classes of the card sides.

You can see a working example here: https://jsfiddle.net/poooow/g0zjt5eL/

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Center align for drop-down menu

I'm currently working on styling an asp:DropDownList element using custom CSS. I have successfully set the height, but I am facing a challenge with getting the text to align in the middle of the element rather than at the bottom. The vertical-align:mi ...

Placing HTML elements inside of the <code> tag is a common practice

After spending years working on backend technologies like PHP and C#, I am now diving back into front-end development. To enhance my understanding of Bootstrap, I am creating my own local reference page where I can easily access the widgets generated to di ...

What is the best way to tailor specific text in d3.js?

I need assistance with customizing the appearance of an asterisk added to the end of a template literal in d3js. I want to be able to independently adjust the size and color of the asterisk regardless of the variable it's attached to. Below is the cod ...

JavaScript's connection to the CSS property visibility seems to be causing some issues

The Javascript code seems to be ignoring the CSS display property, even though it's set in the style sheet. I added a debugger statement and noticed that the display value was empty. I've been staring at this for some time now, so I must be overl ...

Is there an HTML editing tool that has the ability to collapse code blocks by tags and rearrange them?

I'm in search of a text editor or IDE that includes syntax highlighting and allows me to collapse HTML code blocks by tag. I currently use Eclipse, but its "folding" feature only works on top level tags like TABLE, not child tags like TD and TR. Are t ...

PHP contact form not properly sending complete submission data

I'm facing an issue with my HTML contact form that utilizes JavaScript for a change function. Essentially, I have a dropdown menu for different subjects, and based on the selected option, specific fields should appear. However, when a user fills out t ...

How can the distinctions between two bars be illustrated in high charts?

Is there a way to display different values on a new line between two bar charts using Highcharts plugins? I have created a simple bar chart in Highcharts, but I am looking to show the difference between the two bars on a new line. The concept is illustrate ...

Utilizing the dynamic pairing of Three.js and CSS3 to bring life to animated 3D objects

I am currently working on a project that involves creating 3D Lego elements and assembling them into a figure using animation. I have successfully modeled the elements in Blender and exported them as .obj/mlt files without any issues. However, when it come ...

"Utilizing CSS3 columns to create a layout with one column

I am looking to divide my webpage into multiple columns, starting with three but potentially adding more in the future. My current approach involves using Flexbox to create equal-width columns: <style> .container { display: flex; } .column { ...

Tips on arranging images in a horizontal layout

My images are appearing vertically instead of horizontally when I try to align them. What am I doing wrong? <div class="col-1 text-right pt-4"> <div class="row d-block"> < ...

issue with custom $position-values not being recognized in Bootstrap 5

Having trouble positioning text on top of a bootstrap carousel using Bootstrap's position class. The default values (0,50,100) aren't giving me the appearance I want. I tried adding custom values to the $position-values in my scss file, but they ...

As the browser window is resized, the gap between images widens while the images themselves decrease

Hey there, I'm encountering some trouble with the image links at the top of my page. As I resize the browser or change screen resolutions in media queries using percentages, the images are resizing accordingly. However, I'm noticing that as the i ...

Is it possible to create a visual representation (such as a jpg file) of a website page?

Looking to generate an image of a web page, like creating a miniature version of the HTML and images. It doesn't need to be exact (no need for Flash/JavaScript rendering). I plan to use this on Linux - preferably with a Java library, but a command li ...

Unlock the power of Angular pipes in window.open with URL parameters!

<div class="member-img" onclick="window.open(childEpisode.File_URL | fullPath)"> </div> The fullPath function concatenates the domain part to the relative URL stored in file_URL. However, there seems to be an issue as it i ...

No input values were passed to express-validator

In my node app, I am using express-validator and encountering validation errors for all 4 form fields ("A name is required" and so on). Strangely, when I console.log the errors variable, all values are blank: errors: [{value: '', msg: 'A na ...

Filtering out section boxes does not eliminate empty spaces

Link to Fiddle I've run into a bit of a roadblock while trying to filter my section box for a project I'm currently working on. The issue I'm facing is that instead of collapsing the first section box to display only the filtered options, i ...

When the click event occurs, add a class. After a delay using a timeout function, remove the added

I am currently using Jimdo and I have a section where I can edit all the codes, which is working fine except for one feature. Any assistance would be greatly appreciated! Here is the code that adds a class to an animated SVG image with its status set as d ...

The multiple instances of $("selectort") being clicked are causing the if-then condition to malfunction

I am dealing with a server that generates web pages dynamically using asp.net and I have no control over the content. My goal is to track all button clicks on these pages. You can find an example in JSFiddle at https://jsfiddle.net/forssux/aub2t6gn/2/. ...

Tips for eliminating corner gaps in css

As I dive into the world of CSS, I encountered an issue while working on my webpage. The problem lies in a space that appears on my displayed webpage. .grouping:before, .grouping:after { content: " "; display: table; } .grouping:after { clear: bo ...

CSS - Customizing the appearance of consecutive child divs

I'm struggling with adjusting the margin between two child divs when they follow each other. The current margin is set at 3rem, but I want it to be 1rem if both child containers have the class "narrow": Is there a way to achieve this without changing ...