SVG基础一

基本图形:圆形;
cirle  : 设计属性cx,cy圆中心坐标;r半径;fill填充色;stroke边框颜色;stroke-width边框宽度;
<svg xmlns="http://www.w3.org/2000/svg">
	<circle cx="40" cy="100" r="40" fill="green" stroke="black" stroke-width="20"></circle>
</svg>

效果如图

边框并不会撑大元素
矩形;rect;涉及属性:x,y左上角坐标;width,height宽度和高度;rx,ry弧度
<svg xmlns="http://www.w3.org/2000/svg">
	<rect x="50" y="100" width="100" height="100" fill="green" stroke="black" rx="10" ry='10'></rect>
</svg>

线:line;涉及属性:x1,y1起始坐标;x2,y2终点坐标;stroke(-width)线条颜色及宽度;
<svg xmlns="http://www.w3.org/2000/svg">
	<line x1="50" y1="100" x2="500" y2="500" stroke="black" stroke-width="5"></line>
</svg>

fill="transparent"背景色为透明

<body style="height: 100VH;">
	<!-- g标签;用来分组和组合元素;涉及属性transform=translate(100,100) g标签水平坐标可移动整个分组;--> 
	<!--text标签文字text-anchor="middle"居中;start,end居左居右;font-size="20" 字体大小;垂直居中方法已知目测调整~~~~-->
	<!-- image图片 属性xlink:href图片路径;image放到html中才会生效,坐标依据为左上角-->
	<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">
		<g cursor="pointer" transform=translate(100,100)  stroke="black" stroke-width="5">
			<image x="-25" y="-25" height="50" xlink:href="qihoo.png"></image>
			<text y="2" font-size="20" text-anchor="middle">文字</text>
		</g>
	</svg>
</body>

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值