小编dom*_* kp的帖子

Firefox 中的 CSS 变换旋转像素问题

我正在尝试创建带有变换旋转属性的摆动按钮,它在 Opera 和 Chrome 浏览器中工作正常,但在 Firefox 中它在按钮边框中创建奇怪的像素问题:

Firefox 中的按钮呈现

我的按钮和摆动关键帧的 css 代码

.RedButton {
  background-color: #bc0000;
  border-radius: 7px;
  border: 1px solid #bc0000;
  display: inline-block;
  cursor: pointer;
  color: #fff !important;
  font-family: Arial;
  font-size: 30px;
  font-weight: bold;
  padding: 7px 24px;
  text-decoration: none;
  margin-top: 15px;
  animation: swing 5s infinite;
  -moz-animation: swing 5s infinite;
  transition: 0.2s;
  -moz-transition: 0.2s;
}

@-moz-keyframes swing {
  20%,
  60% {
    -moz-transform: rotate(5deg);
  }
  40%,
  80% {
    -moz-transform: rotate(-5deg);
  }

  100% {
    -moz-transform: rotate(0deg);
  }
}

@keyframes swing {
  20%,
  60% { …
Run Code Online (Sandbox Code Playgroud)

css firefox css-transitions css-transforms

2
推荐指数
1
解决办法
346
查看次数

标签 统计

css ×1

css-transforms ×1

css-transitions ×1

firefox ×1