【发布时间】:2020-06-30 09:35:57
【问题描述】:
我在 Angular 8 应用程序上有一个 svg 动画,一个 svg 圆圈在 chrome 和 mozilla 上工作正常,但在 IE 11 上不起作用。有什么想法让它也能在那里工作吗?如何将我的 css 更改为也可以在 IE 11 上工作?感谢您的关注。期待您的回复。
我在标题中添加了 IE 元数据:
<meta http-equiv="X-UA-Compatible" content="IE=edge">
直播example
#countdown {
position: relative;
margin: auto;
height: 40px;
width: 40px;
text-align: center;
}
#countdown-number {
color: #1C5BA2;
display: inline-block;
line-height: 40px;
}
svg {
position: absolute;
top: 0;
right: 0;
width: 40px;
height: 40px;
transform: rotateY(-180deg) rotateZ(-90deg);
}
svg circle {
stroke-dasharray: 113px;
stroke-dashoffset: 0px;
stroke-linecap: round;
stroke-width: 2px;
stroke: #1C5BA2;
fill: none;
-webkit-animation: countdown 31s linear forwards;
animation: countdown 31s linear forwards;
}
@keyframes countdown {
from {
stroke-dashoffset: 0px;
}
to {
stroke-dashoffset: 113px;
}
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row mt-5">
<div class="col">
<div id="countdown">
<div id="countdown-number"></div>
<svg>
<circle r="18" cx="20" cy="20"></circle>
</svg>
</div>
</div>
</div>
</div>
my index
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>App Name</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
</head>
<body>
<app-root></app-root>
</body>
</html>
【问题讨论】:
-
这能回答你的问题吗? SVG animation is not working on IE11
标签: css internet-explorer svg-animate