SVG-矢量图-奥运五环及奥迪标志

SVG继续基础玩法。

 

知识点一:style属性可以快速填写部分对应的值,但不是所有值都可以这样写。

知识点二:fill属性用来表示填充色,transparent表示透明,这可以实现空心圆。

<svg xmlns="http://www.w3.org/2000/svg" enable-background="gray">
  <circle cx="100" cy="100" r="50" fill="blue" stroke="aquamarine" stroke-width="10"></circle>
  <circle cx="200" cy="100" r="50" fill="transparent" stroke="aquamarine" stroke-width="10"></circle>
<!--  style属性的配置与上面的配置实现效果是一样的,但并不是所有的属性均可如此设置-->
  <circle cx="300" cy="100" r="50" style="fill:transparent;stroke:black;stroke-width:10"></circle>
</svg>

效果图:

好,回到正题,奥运五环和奥迪车标代码和效果图如下:

先看代码

<!--svg根节点标签,需要引入命名空间-->
<svg xmlns="http://www.w3.org/2000/svg" enable-background="gray">
<!--  奥运五环-->
  <circle cx="100" cy="100" r="50" fill="transparent" stroke="blue" stroke-width="10"></circle>
  <circle cx="230" cy="100" r="50" fill="transparent" stroke="black" stroke-width="10"></circle>
  <circle cx="360" cy="100" r="50" fill="transparent" stroke="red" stroke-width="10"></circle>
  
  <circle cx="165" cy="150" r="50" fill="transparent" stroke="yellow" stroke-width="10"></circle>
  <circle cx="295" cy="150" r="50" fill="transparent" stroke="green" stroke-width="10"></circle>
  
  
<!--  奥迪车标-->
  <circle cx="100" cy="300" r="50" fill="transparent" stroke="black" stroke-width="10"></circle>
  <circle cx="170" cy="300" r="50" fill="transparent" stroke="black" stroke-width="10"></circle>
  <circle cx="240" cy="300" r="50" fill="transparent" stroke="black" stroke-width="10"></circle>
  <circle cx="310" cy="300" r="50" fill="transparent" stroke="black" stroke-width="10"></circle>
</svg>

效果图

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

King·Forward

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值