微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

html5 SVG 涂鸦

<!DOCTYPE HTML>
<html>
<body>

<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="1000px" height="800px">

<rect
	x="20" 
	y="20" 
	rx="20" 
	ry="20" 
	width="250" 
	height="100" 
	style="fill:red;stroke:black;stroke-width:5;fill-opacity:0.5;stroke-opacity:0.5"/>

<circle 
	cx="100" 
	cy="160" 
	r="40" 
	stroke="black"
	stroke-width="2" 
	fill="red"
	style="fill:green;opacity:0.5"/>


<ellipse cx="240" cy="230" rx="220" ry="30" style="fill:purple"/>

<ellipse cx="220" cy="270" rx="190" ry="20" style="fill:lime"/>

<ellipse cx="210" cy="345" rx="170" ry="15" style="fill:yellow"/>

<line x1="0" y1="0" x2="300" y2="300" style="stroke:rgb(99,99,99);stroke-width:2"/>

<polygon points="220,400 300,610 170,650 123,434" style="fill:#cccccc; stroke:#000000;stroke-width:1"/>

<polyline points="400,0 400,20 420,40 440,60" style="fill:white;stroke:red;stroke-width:2"/>

<path d="M153 334
C153 334 151 334 151 334
C151 339 153 344 156 344
C164 344 171 339 171 334
C171 322 164 314 156 314
C142 314 131 322 131 334
C131 350 142 364 156 364
C175 364 191 350 191 334
C191 311 175 294 156 294
C131 294 111 311 111 334
C111 361 131 384 156 384
C186 384 211 361 211 334
C411 300 886 674 500 600"
style="stroke:red;stroke-width:2"/>

<defs>
	<filter id="Gaussian_Blur">
		<feGaussianBlur in="SourceGraphic" stdDeviation="20"/>
	</filter>
</defs>

<ellipse 
	cx="500" 
	cy="150" 
	rx="70" 
	ry="40"
	style="fill:#ff0000;stroke:#000000;stroke-width:2;filter:url(#Gaussian_Blur)"/>

<defs>
	<linearGradient id="orange_red" x1="0%" y1="0%" x2="100%" y2="0%">
		<stop offset="0%" style="stop-color:rgb(255,255,0);stop-opacity:1"/>
		<stop offset="100%" style="stop-color:rgb(255,0);stop-opacity:1"/>
	</linearGradient>
</defs>

<ellipse cx="720" cy="190" rx="85" ry="55" style="fill:url(#orange_red)"/>


<defs>
	<radialGradient id="grey_blue" cx="50%" cy="50%" r="80%" fx="50%" fy="50%">
		<stop offset="0%" style="stop-color:rgb(200,200,200);stop-opacity:0"/>
		<stop offset="100%" style="stop-color:rgb(0,255);stop-opacity:1"/>
	</radialGradient>
</defs>

<ellipse cx="750" cy="400" rx="110" ry="100" style="fill:url(#grey_blue)"/>

</svg>

</body>
</html>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。