【问题标题】:firefox 49, border-radius + overflow:hidden not workingfirefox 49,边界半径+溢出:隐藏不起作用
【发布时间】:2017-02-03 09:36:45
【问题描述】:

我为按钮制作了动画,它适用于所有最新版本的浏览器,但我已将 Firefox 从 v.48 更新到 v.49之后我的动画就坏了。如果有人知道到底发生了什么,请帮助我

示例: https://jsfiddle.net/3woa73fz/(出现和消失的左侧线) 代码:

HTML:

<div class="button__container">
  <a href="#" class="button">
     <span class="button__text">Learn More</span>
  </a>
</div>

CSS:

.button {
  &__container {
    position: relative;
    left: 0;
    right: 0;
    bottom: 0;
  }

  overflow: hidden;
  display: inline-block;
  position: relative;
  -webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);

  height: 54px;

  margin: 0 auto;
  padding: 15px 38px 14px 37px;

  background-color: transparent;
  border-radius: 200px;

  color: transparent;

  cursor: pointer;

  &:before {
    content: '';

    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    background-color: #fff;

    transform: translateX(-100%);

    transition: transform 0.3s ease;
  }
  &:after {
    content: '';

    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: inherit;

    transition: border 0.3s ease;

    z-index: 1;
  }
  &__text {
    position: relative;

    font-family: sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #fff;

    transition: color 0.3s ease;
  }
}

.button:hover:before {
    transform: translateX(0);
  }
  .button:hover:after {
    border-color: #fff;
  }
  .button:hover .button__text {
    color: #24BE51;
  }
}

【问题讨论】:

    标签: css firefox overflow positioning pseudo-element


    【解决方案1】:

    ".button" 内尝试添加:

    掩码: url(数据:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);

    ".-webkit-mask-image"之后

    【讨论】:

    • 谢谢!现在很好用
    猜你喜欢
    • 2017-03-01
    • 2011-10-06
    • 2021-12-29
    • 1970-01-01
    • 2012-05-06
    • 1970-01-01
    • 2011-08-06
    • 2018-08-10
    • 2016-04-20
    相关资源
    最近更新 更多