svg画的各种图形 1

通过svg 画出的矩形   圆形   叠加的椭圆   直线    折现    多边形    还有五角星  各种例子以及图案,还有代码

 

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title></title>

</head>

<body>

<!--矩形 -- >rect)

<svg <!--viewBox="0 0 100 100"-->>

<rect width="100" height="100" fill="red" stroke="blue" stroke-width="10"   stroke-opacity="0.9"  x="10" y="10"  rx="10" ></rect>

</svg>

<!--圆形-- > (scrcle)

<svg>

<scrcle  cx="100" cy="70"  r="60"  fill="red"></scrcle>

</svg>

 椭圆  (ellipse)

<svg>

<ellipse cx="100"  cy="70"  rx="60" ry="70"></ellipse>

</svg>

 

<!--叠加的椭圆-->

<svg>

<ellipse cx="100"  cy="70"  rx="70" ry="50" fill="skyblue"></ellipse>

<ellipse cx="100"  cy="60"  rx="60" ry="40" fill="blue"></ellipse>

<ellipse cx="100"  cy="50"  rx="50" ry="30" fill="green"></ellipse>

</svg>

 

<!--直线-->

<svg>

<line x1 ="50" x2="50 "  y1="100"  y2="100" fill="red"  stroke="red" stroke-width="1" stroke-linecap="round" > </line>

</svg> 

 

 

<!--折现 -->polyline

 

<svg>     在这polyling 和polygon 的区别是  polyling是折现不封闭缺口画完图型以后不再回到起点   ,而polygon封闭缺口,画完图型以后再回到起点 ,请看下面的图形

<polyline points="50,50 100, 100 170,50" stroke-width="2" stroke="blue" fill="red"></polyline>

</svg>

 

<!--多边形 -->     

<svg>

<polygon  points="50,50 100, 100 170,50" stroke-width="2" stroke="blue" fill="white"></polygon >

</svg> 

 

<!--五角星 -->

<svg>

<polygon  points="15,100 95, 100 30,150 55,70 80,150" stroke-width="2" stroke="blue" fill="red" fill-rule="evenodd"></polygon >

</svg>

 

</body>

</html>

 

转载于:https://www.cnblogs.com/sanshao221/p/6207085.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值