首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >内联SVG并不总是显示在Chrome中

内联SVG并不总是显示在Chrome中
EN

Stack Overflow用户
提问于 2019-11-26 04:34:48
回答 1查看 52关注 0票数 0

哈哈!

所以我有一大块内联SVG代码,所以我可以用一些css来动画它,我已经把SVG内联代码放在一个pastebin中,如果我把它放在这里,它将是巨大的。现在的问题是,它没有在Chrome中显示出来。对应的SCSS:

代码语言:javascript
复制
#logo {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translate(-50%, -50%);
  stroke-linecap: square;
  z-index: 1;
}

#logo path {
  &:nth-child(1) {
    stroke-dasharray: 500.82;
    stroke-dashoffset: 500.92;
    animation: line-anim 1.5s ease forwards;
  }

  &:nth-child(2) {
    stroke-dasharray: 313.24163818359375;
    stroke-dashoffset: 313.24163818359375;
    animation: line-anim 1.5s ease forwards 0.3s;
  }

  &:nth-child(3) {
    stroke-dasharray: 350.793212890625;
    stroke-dashoffset: 350.793212890625;
    animation: line-anim 1.5s ease forwards 0.6s;
  }

  &:nth-child(4) {
    stroke-dasharray: 327.3361511230469;
    stroke-dashoffset: 327.3361511230469;
    animation: line-anim 1.5s ease forwards 0.9s;
  }

  &:nth-child(5) {
    stroke-dasharray: 282.18719482421875;
    stroke-dashoffset: 282.18719482421875;
    animation: line-anim 1.5s ease forwards 1.2s;
  }

  &:nth-child(6) {
    stroke-dasharray: 313.2420959472656;
    stroke-dashoffset: 313.2420959472656;
    animation: line-anim 1.5s ease forwards 1.5s;
  }

  &:nth-child(7) {
    stroke-dasharray: 386.1973876953125;
    stroke-dashoffset: 386.1973876953125;
    animation: line-anim 1.5s ease forwards 1.8s;
  }

  &:nth-child(8) {
    stroke-dasharray: 365.17633056640625;
    stroke-dashoffset: 365.17633056640625;
    animation: line-anim 1.5s ease forwards 2.1s;
  }

  &:nth-child(9) {
    stroke-dasharray: 296.4239501953125;
    stroke-dashoffset: 296.4239501953125;
    animation: line-anim 1.5s ease forwards 2.4s;
  }

  &:nth-child(10) {
    stroke-dasharray: 350.7937316894531;
    stroke-dashoffset: 350.7937316894531;
    animation: line-anim 1.5s ease forwards 2.7s;
  }

  &:nth-child(11) {
    stroke-dasharray: 365.1751708984375;
    stroke-dashoffset: 365.1751708984375;
    animation: line-anim 1.5s ease forwards 3s;
  }

  &:nth-child(12) {
    stroke-dasharray: 313.2421875;
    stroke-dashoffset: 313.2421875;
    animation: line-anim 1.5s ease forwards 3.3s;
  }

  &:nth-child(13) {
    stroke-dasharray: 482.3141174316406;
    stroke-dashoffset: 482.3141174316406;
    animation: line-anim 1.5s ease forwards 3.6s;
  }
}

我已经在Edge上试过了,它确实显示出来了,但非常奇怪。在FireFox上根本没有显示,昨天一切正常,现在我在项目中走得更远了,我以为这是我后来添加的一些SCSS,但事实也不是这样。

任何帮助都将不胜感激

EN

回答 1

Stack Overflow用户

发布于 2019-11-26 04:55:59

我太傻了,我在清理css的时候不小心删除了line-anim关键帧,谢谢你提醒我@enxaneta

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59039693

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档