user1851758
user1851758

Reputation: 97

Creating crossing line elements in html page with svg

I'd like to create two crossing lines which would look like an 'X' with svg. I have tried the following, but only one line shows up. Probably a really simple issue, but I haven't figured out a solution.

<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>

Upvotes: 0

Views: 242

Answers (1)

Sebastian Brosch
Sebastian Brosch

Reputation: 43604

Your code has some errors. Simply add / to the end of the <line> tags:

<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>

Upvotes: 1

Related Questions