【问题标题】:I've an error with SVG and google fonts "Monoton"我对 SVG 和谷歌字体“Monoton”有一个错误
【发布时间】:2021-04-25 17:53:33
【问题描述】:

大家好, 当我在浏览器中打开 svg 文件时,它给了我一个“第 4 行第 76 列的错误:EntityRef:期待';' " 这是 svg 代码:

<svg xmlns="http://www.w3.org/2000/svg" width="96.75" height="33" viewBox="0 0 387 132">
  <defs>
    <style>
      @import url('https://fonts.googleapis.com/css2family=Monoton&display=swap');
      .cls-1 {
        font-size: 150px;
        fill: #888;
        font-family: Monoton;
      }
    </style>
  </defs>
  <text id="DAG" class="cls-1" x="-7.001" y="126.575">DAG</text>
</svg>

【问题讨论】:

    标签: css svg google-font-api google-fonts


    【解决方案1】:

    删除:&amp;display=swap(第 4 行,第 76 列)

    <svg xmlns="http://www.w3.org/2000/svg" width="96.75" height="33" viewBox="0 0 387 132">
      <defs>
        <style>
          @import url('https://fonts.googleapis.com/css2family=Monoton');
          .cls-1 {
            font-size: 150px;
            fill: #888;
            font-family: Monoton;
          }
        </style>
      </defs>
      <text id="DAG" class="cls-1" x="-7.001" y="126.575">DAG</text>
    </svg>

    【讨论】:

    • 谢谢,我还要把引号放在“Monoton”里
    • 不一定
    猜你喜欢
    • 1970-01-01
    • 2014-01-28
    • 2011-05-11
    • 2014-07-01
    • 1970-01-01
    • 2022-11-20
    • 1970-01-01
    • 2012-11-29
    • 2018-10-22
    相关资源
    最近更新 更多