Odd glitch / shimmer in css animation

While attempting to animate a simple circle, I've encountered a strange flicker on one side that appears to be pushing inward. This issue persists even when using keyframes for animation and across various browsers.

Any assistance with this problem would be greatly appreciated.

.frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 400px;
  height: 400px;
  margin-top: -200px;
  margin-left: -200px;
  border-radius: 2px;
    box-shadow: 4px 8px 16px 0 rgba(0,0,0,0.1);
    overflow: hidden;
  background: #fff;
  color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #E56262;
}

.center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
    z-index: 3;
}

.circle {
    background-color: #fff;
    width: 100px;
    height: 100px;
    border-radius:50%;
    box-shadow: 0px 0 15px 2px #424040;
    position: relative;
    z-index: 4;
    transition: all 1s;
    
}
.circle:hover {
        transform: scale(1.5);
    }

@keyframes scaleMe {
    0% {
        transform: scale(0%);
    }
    50% {
        transform: scale(100%);
    }
    100% {
        transform: scale(0%);
    }
}
<div class="frame">
  <div class="center">
        <div class="circle"></div>
  </div>
</div>

Answer №1

It seems like your issue is quite similar to this one: CSS Animation break transform

I managed to fix the flickering by removing the transform(-50%, -50%) and centering your div in a different way, which made it look okay.

.frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 400px;
  height: 400px;
  margin-top: -200px;
  margin-left: -200px;
  border-radius: 2px;
box-shadow: 4px 8px 16px 0 rgba(0,0,0,0.1);
overflow: hidden;
  background: #fff;
  color: #333;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
background-color: #E56262;
  display: flex;
}

.center {
  margin: auto;
z-index: 3;
}

.circle {
background-color: #fff;
width: 100px;
height: 100px;
border-radius:50%;          
box-shadow: 0px 0 15px 2px #424040;
position: relative;
z-index: 4;
transition: all 1s;
}

.circle:hover {
transform: scale(1.5);
}

  @keyframes scaleMe {
      0% {
          transform: scale(0%) translate(-50%,-50%);
      }
      50% {
          transform: scale(100%) translate(-50%,-50%);
      }
      100% {
          transform: scale(0%) translate(-50%,-50%);
      }
  }
<div class="frame">
  <div class="center">
<div class="circle"></div>
  </div>
</div>

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

Which specific combination of CSS and HTML attributes can cause an image to not display correctly in the Safari browser?

The image labeled "GIANT MANGO" is supposed to be displayed in the center below this text. While it appears correctly in Firefox, Chrome, and IE, it unfortunately does not show up on Safari browser. To view the image, visit Any suggestions on how to fix ...

The Owl carousel seems to be malfunctioning as there are no error messages displayed and the div containing it disappears unexpectedly

I'm having an issue with Owl carousel. I've included the necessary owl.carousel.css, owl.carousel.js, and owl.theme.css files. Created a div with the class "owl-carousel", and called the function $(".owl-carousel").owlCarousel();. However, after ...

What safety measures should be implemented when granting users permission to modify HTML and CSS on your site?

I'm really impressed by the customization options on Tumblr. Users can edit the HTML and CSS of their profiles, which is something I'd love to incorporate into my own site. However, I'm concerned about the security implications of allowing t ...

Positioning a full-width background-image in the center is causing the page to expand

I've been struggling to find a solution to this issue for hours, scouring the internet with no success. The problem I'm facing is trying to center a background image on the page. However, when using the method shown here, it ends up stretching t ...

Difficulty displaying list items/links in Bootstrap Navbar

Currently, I am diving into the world of Bootstrap and experimenting with different components, particularly the navbar feature. However, I've encountered an issue where my links or list items are not visible on the page. I have double-checked the co ...

Customizing the appearance of checkboxes in React Material-Table filtering feature

Is there a way to modify the style of checkboxes in filtering? For instance, if I wish to adjust the dimensions of the checkbox that appears for the Birth Place field, what steps should I take? https://i.stack.imgur.com/pZLqQ.png ...

Enhancing websites with font-awesome icons and upgrading from older versions to the latest

Seeking guidance on updating our project to use the latest Macadmine theme. The transition from Font Awesome 3 to Font Awesome 4 requires changing all icons to their proper names. I came across a helpful resource at https://github.com/FortAwesome/Font-Aw ...

IE7 z-index issue with incorrect stacking order

Visit this jsFiddle link. When using IE7, the code in the jsFiddle above shows the dropdown (.sbOptions) positioned beneath the next selectbox element (.sbHolder). Even though .sbOptions has a z-index: 100;, it is still being displayed under .sbHolder. ...

An issue arising from code in Python, JavaScript, HTML, and CSS

I am currently studying JavaScript and Python and have encountered an issue with my code. I wrote a script that is supposed to create a file and input data into it, but the recv_data function is not functioning correctly - the file is not being created. Ca ...

Gap created between two td or tr elements

Can someone please help me solve a troubling issue I'm facing with my CSS and HTML code? body { background-color:#ffffff; margin:0; padding-top:0px; } table.main-table-default { margin:0 auto; background-color:#00ffff; width:700px; border-collapse:co ...

Ways to include scrolling specifically for one template

As a newcomer to frontend development, I have recently started learning Vue and the Quasar Framework. I am currently working on a table and trying to set a fixed table name with only the table items scrollable. <template> <q-table virt ...

Issue with top-level navigation menu dropdown functionality

I am experiencing an issue with a dropdown menu that has top level and two sub levels. The problem is that while the sub levels function correctly when clicked, the top level does not navigate to the intended page upon clicking. var menu_Sub = $(".men ...

I'm struggling to solve a straightforward jQuery sliding issue

I am struggling to make text slide from right to left on my website. I want the text to appear only when the page loads or refreshes, and then slide off when a link is clicked, revealing new text. Can anyone help me figure this out? http://jsfiddle.net/XA ...

Using JQuery to automatically set the default selection when toggling the visibility of a div

I currently have a script that toggles the visibility of a div when selected: $('.showSingle').click(function () { $('.targetDiv').hide(); $('.showSingle').removeClass('greenactive'); $(this).addCla ...

Learn the trick to make this floating icon descend gracefully and stick around!

I'm trying to create a scrolling effect for icons on my website where they stay fixed after scrolling down a certain number of pixels. I've managed to make the header fixed after scrolling, but I'm unsure how to achieve this specific effect. ...

Generate a "tag" using the given text

I am in need of creating a unique tag for every item within a loop. My goal is to be able to click on each item individually and then make an AJAX request, but I'm unsure of how to accomplish this. I am using Bootstrap as my CSS framework which may he ...

Issue with CSS on various mobile devices

Using this CSS to display a fixed part at the bottom of the mobile screen, I noticed that it works well on the Samsung Grand Prime but appears narrower on the Samsung J7 Max. Here is the code snippet and images for reference: .footer { position: fixed ...

When resizing the browser, the divs stack neatly without overlapping

We need to ensure that the 4 divs stack on top of each other without overlapping! The header should have the same width as the footer, 100% The menu should stack with the header and footer The content should be centered on the page and stack with the oth ...

Ways to display multiple select options based on the user's selection of multiple choices and ensure they remain hidden and reset when deselected with the use of

There is a select options field that contains languages, where the user can choose multiple language options or just one. When the user selects a language, a new select option should appear for them to choose their proficiency level in that language. If t ...

Solved the issue of inconsistent element height and jumping on mobile devices during scrolling

Problem persists with the fixed element at the bottom of my mobile device when I scroll. It seems that the height is recalculated each time due to an increase in document height on mobile devices. The issue appears to be related to the address bar fading ...