css 弧形文本-svg

<!DOCTYPE html>
<html> 
  <head> 
    <meta charset="UTF-8"> 
    <title></title>
    <style type="text/css">
      body{
        background: #000;
      }

     /* svg{
        width: 1000px;
        height: 500px;
      }*/
      path {
        fill: #4682B4;
      }
      text {
            stroke: #fff;
            stroke-width: 1;
            font-size: 20px
           
      }
      svg text {
          fill: #fff;/* 文字颜色 */
          stroke: #f7f9fb6b;/* 文字边框颜色 */
          stroke-width: 3;/* 边框宽度 */
          text-anchor: middle;  /* 文本水平居中 */
          /*dominant-baseline: middle; /* 文本垂直居中 */*/
        }
    </style> 
  </head> 
  <body>
      <svg viewBox="0 0 1000 500">
        <defs>
          <path id="MyPath"
            d="M 10,150
              C 150 170 220 240 1000 160
              M 10,150
              " />
        </defs>
        <!-- Show line of the viewport red-->
        <!-- <use xlink:href="#MyPath" fill="none" stroke="red"  /> -->

        <text  font-size="50"  >
          <textPath xlink:href="#MyPath" startOffset="50%">
            我是一段乖巧的实例文字centerdtextdpath元
          </textPath>
        </text>

        <!-- Show outline of the viewport using 'rect' element -->
        <!-- <rect x="1" y="1" width="998" height="298"
            fill="none" stroke="black" stroke-width="2" /> -->
      </svg>
  </body>
</html>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值