Issue with CSS3 box-shadow transitions failing specifically in Firefox

Can anyone explain why this transition works in Safari and Chrome (Webkit browsers), but not in Firefox (Mozilla)?

a.lorem {
    width: 100px;
    padding: 20px;
    display: block;
    color: white;
    text-align: center;
    background: rgb(191,210,85);
    background: -moz-linear-gradient(top,  rgb(191,210,85) 0%, rgb(142,185,42) 50%, rgb(114,170,0) 51%, rgb(158,203,45) 100%);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(191,210,85)), color-stop(50%,rgb(142,185,42)), color-stop(51%,rgb(114,170,0)), color-stop(100%,rgb(158,203,45)));
    background: -webkit-linear-gradient(top,  rgb(191,210,85) 0%,rgb(142,185,42) 50%,rgb(114,170,0) 51%,rgb(158,203,45) 100%);
    background: -o-linear-gradient(top,  rgb(191,210,85) 0%,rgb(142,185,42) 50%,rgb(114,170,0) 51%,rgb(158,203,45) 100%);
    background: -ms-linear-gradient(top,  rgb(191,210,85) 0%,rgb(142,185,42) 50%,rgb(114,170,0) 51%,rgb(158,203,45) 100%);
    background: linear-gradient(to bottom,  rgb(191,210,85) 0%,rgb(142,185,42) 50%,rgb(114,170,0) 51%,rgb(158,203,45) 100%);
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bfd255', endColorstr='#9ecb2d',GradientType=0 );
    box-shadow: inset 0 -3px 0 #A9A9A9,
                0 3px 0 #EFEFED;
    -webkit-transition: box-shadow .5s linear;
    -moz-transition: box-shadow .5s linear;
    -o-transition: box-shadow .5s linear;
    -ms-transition: box-shadow .5s linear;
    transition: box-shadow .5s linear;
}

a:hover.lorem {
    box-shadow: 0 3px 0 rgba(0, 0, 0, .1),
                inset 0 -3px 0 rgba(0, 0, 0, .1),
                inset 0 0 100px rgba(255, 255,255 , .3);
}

Check out the Fiddle here

Answer №1

To start off, it's important to remember to write a.lorem:hover instead of a:hover.lorem

Next, when dealing with multiple values for box-shadow, make sure they correspond correctly to their ":hover" pair. The transition from an "inset" shadow to an "outset" shadow is not possible.

For example:

a.lorem{
  box-shadow: 
      inset 0 -3px 0 #A9A9A9,
            0  3px 0 #EFEFED,
      inset 0  0   0 rgba(0,0,0,0); /* this is for the third ":hover" value */
  transition:box-shadow .5s linear; /* don't forget to add prefixed versions (-moz-, -webkit-, ...) */
}
a.lorem:hover{
  box-shadow: 
      inset 0 -3px  0     rgba(0, 0, 0, .1),
            0  3px  0     rgba(0, 0, 0, .1), 
      inset 0  0    100px rgba(255, 255,255 , .3);
}

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

Exploring the world of CSS preprocessors as a beginner

As someone who is still learning CSS, I find it a bit difficult to keep my stylesheets organized. With around 800 lines of CSS, it's becoming more and more challenging for me. While experienced developers might not have an issue with this, it's d ...

I'm having trouble getting Pycharm to locate my static files

My Pycharm is having trouble locating my CSS files. I've attached a screenshot showing the settings.py file, the directory where the .css file is located, and the error message from the terminal indicating a 404 error. Could someone please help me ide ...

Animation displayed on page load before running

Is there a way to ensure that my animation runs smoothly without any lag or jankiness, either while the page is loading or immediately after loading? I have attempted to preload the images using a preload tag in the header of my HTML, but unfortunately, t ...

Spinning in a clockwise direction for 180 degrees, followed by a full

I am seeking a solution to rotate a cog icon clockwise by 180 degrees when activated with the class "cards__cog cards__cog-active" and then rotate another 180 degrees clockwise back to its deactivated state using the class "cards__cog cards__cog-inactive". ...

Is there a way to maintain image proportions when resizing the window?

I'm in the process of developing a classroom-themed website with interactive overlaying images. The goal is to have various pictures that users can click on to access different resources from different websites. My main challenge right now is getting ...

What is the best method for incorporating a unique style to a v-dialog component in Vuetify following the most recent update?

I'm currently working on a project using vuetify, and I am facing an issue while trying to add a custom class to a v-dialog component. I have tried searching for information on how to do this, but it seems that the prop "content-class" has been deprec ...

The alignment of divs can be disrupted in a Nested Grid system

I am working with a 16 grid system where I have two 8 column divs positioned side by side. In one of the 8 column divs, I am trying to include a 5 column div on the left and two three columns divs stacked on top of each other on the right. I have tried v ...

Using JavaScript, create a set of buttons within a div element and implement

$(document).ready(function() { $('#b1').click(function() { $('#uch').toggle("slow"); }); $('#b2').click(function() { $('#uch2').toggle("slow"); }) }) Although I'm not a program ...

Zooming on a webpage is causing problems

One issue I'm facing is with the elements on my page acting strange when I zoom in and out. Everything seems to be working fine except for a container div that should overlay a color over the image background. When I zoom in or switch to mobile view, ...

Clarity of visual in a lattice

I'm encountering a small issue with my ExtJS 4.2 MVC application that involves grid and image transparency. Below is a snippet of my grid setup: Ext.define('XProject.view.message.inbox.Grid', { extend: 'Ext.grid.Panel', al ...

Is there a way to automatically override the CSS cursor style?

Issue with SCSS styling on image link I attempted to modify the cursor style from pointer to default, but after saving and reloading my React app, the change did not take effect. I tried writing some code, but it seems that Stack Overflow is indicating an ...

using javascript to dynamically color rows in a table based on the value in the status field

Hi, I'm new to javascript and seeking help for my table coloring issue. I have a dynamic table where data is inserted through an Ajax call. The goal is to color specific records based on their status. I attempted a solution but only one record gets c ...

Troubleshooting a unique CSS bug in jQuery mouseover functionality

Check out this pen: https://codepen.io/anon/pen/eKzEVX?editors=1111 I recently created a Form Select in Laravel: {!! Form::select('status_id', $statuses, $post->status_id, ['class' => 'form-control post-sub-items-label &apo ...

Is it possible to add animated text using anime.js?

var elements = document.querySelectorAll('.content'); anime({ targets: elements, content: 100, }); <script src="https://raw.githubusercontent.com/juliangarnier/anime/master/lib/anime.min.js"></script> <span class="content"> ...

Display additional links in Bootstrap navigation bar with a second level menu

Currently, I am integrating Bootstrap into an ASP.NET application using C#. Within this application, I have implemented a two-level menu system where certain options are available to users and others are only visible to administrators. The decision on whic ...

I'm having trouble getting my .click method to work with the <div id=menuButton>. Can anyone help me figure out why this is happening?

Here is the HTML code I created for a dropdown menu. Initially, in the CSS file, the menu is set to display: none; <!doctype html> <html> <head> <title>DropDown Menu</title> <link rel="stylesheet" href="normalize ...

What is the best way to ensure that all the divs within a grid maintain equal size even as the grid layout changes?

I have a grid of divs with dimensions of 960x960 pixels, each block is usually 56px x 56px in size. I want to adjust the size of the divs based on the changing number of rows and columns in the grid. Below is the jQuery code that I am using to dynamicall ...

Problem with aligning the image

We are currently struggling with keeping a 2000px wide by 580px height image centered when the browser is resized. It starts off centered, but as we adjust the size of the window, the image loses its centering. I have seen websites where a large image rema ...

Tips for designing a doodle logo that includes a magnifier lens effect when hovered over

I have a vision for a unique and creative logo solution that involves incorporating a magnifier glass effect. When a user hovers over a certain area of the logo, I want it to zoom in with a magnifier glass effect. I haven't been able to find much info ...

Difficulty with the responsiveness of a website due to issues with the bootstrap grid system

I've been working with a Bootstrap grid that you can find at . While it works perfectly on large desktop screens, everything is a bit messy on mobile devices. The "NEW" text specifically is not visible on mobile and doesn't seem to be responsive. ...