svg 圈线圈案例

在这里插入图片描述代码示例:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width:780px;
            height:400px;
            margin:0 auto;
        }
    </style>
</head>
<body>
    <div style="border:solid 1px orange;" class='box'>

        <svg  width='100%' height='100%'
        xmlns="http://www.w3.org/2000/svg">
        <!-- 绘制线条部分 -->
            <g style="cursor:pointer">
                <line x1="100" y1="100" x2='390' y2='200' stroke='#ccc'></line>
                <!-- 因为线段不能用fill来填充颜色,所以要设置一个相同的外边框透明且比原线宽度大的线去覆盖原来的,好点击 -->
                <line x1="100" y1="100" x2='390' y2='200' stroke='transparent' stroke-width='5'></line>
                <rect x='235' y='140' fill='#2995FF' height='20' width='20' rx='5'></rect>
                <text x='245' y='155' text-anchor='middle' fill='white'>?</text>
            </g>
            <!-- 绘制上圆 -->
            <g style="cursor:pointer">
                <circle cx='100' cy='100' r='40' fill='white' stroke='#FF0000'></circle>  
                <text x='100' y='105' text-anchor='middle' font-size='10'>文字一</text>
            </g>
            <!-- 绘制下圆 -->
            <g style="cursor:pointer">
                <circle cx='390' cy='200' r='60' fill='white' stroke='#FF0000'></circle>
                <text x='390' y='205' text-anchor='middle' font-size='10'>文字二</text>
            </g>
        </svg>
        
        
    </div>

    
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值