2016-03-18 7 views
0

svgで 'X'のように見える2つの交差線を作成したいと思います。私は以下を試しましたが、1行しか表示されません。おそらく本当に簡単な問題ですが、私は解決策を見つけ出していません。svgを使ってhtmlページの横線要素を作成する

<svg id="min-1"width="26" height="14" style="display:block"> 
 
    <line x1="4" y1="3" x2="22" y2="11" style="stroke:#5A5A5A; stroke-width:3"> 
 
    <line x1="4" y1="11" x2="22" y2="3" style="stroke:#5A5A5A; stroke-width:3"> 
 
</svg>

答えて

1

あなたのコードは多少の誤差があります。

<svg id="min-1"width="26" height="14" style="display:block"> 
 
    <line x1="4" y1="3" x2="22" y2="11" style="stroke:#5A5A5A; stroke-width:3"/> 
 
    <line x1="4" y1="11" x2="22" y2="3" style="stroke:#5A5A5A; stroke-width:3"/> 
 
</svg>

:単に <line>タグの最後に /を追加
関連する問題