SVG的使用

一,svg可以在浏览器中直接打开

二,在html使用<img/>标签引用

三,直接在html中使用svg标签

四,作为css背景

SVG支持ie9+ ,chrome 33.0+,firefox 28.0+,safari 7.0+

下面是一个结合了html5中的知识做简单的小demo

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>SVG</title>
<style type="text/css">
#progress {
stroke-dasharray: 100px;
stroke-dashoffset: 100px;
}
#progress {
stroke-dasharray: 100px;
stroke-dashoffset: 100px;
animation: progressAnimation 2000ms linear infinite;
}

@keyframes progressAnimation {
from {
stroke-dashoffset: 100px;
}
to {
stroke-dashoffset: 300px;
}
}

</style>
</head>
<body>
<svg width="240" height="240" xmlns="">
<circle r="90" cy="120" cx="120" stroke-width="3" stroke="#333" fill="none"/>
<circle id="progress" r="90" cy="120" cx="120" stroke-width="3" stroke="#00ff00" fill="none"/>
</svg>
</body>
</html>

 

posted @   不再犯错  阅读(584)  评论(0编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
点击右上角即可分享
微信分享提示