search

Home  >  Q&A  >  body text

How to make a diamond shape using the <svg> element?

<p>I'm trying to create a diamond using the <code><svg></code> and <code><polygon></code> HTML5 elements. I specified the point, but instead of being filled into a rhombus, it was filled into a pair of triangles. This is my approach: </p> <p> <pre class="brush:html;toolbar:false;"><div> <svg width="2000" height="2000"> <polygon points="25 25, 75 25, 50 50, 50 0" style=" fill: blue; stroke:black;"/> </svg> </div> </pre> </p>
P粉043295337P粉043295337457 days ago473

reply all(1)I'll reply

  • P粉492959599

    P粉4929595992023-08-27 00:48:12

    I hope you like it

    <svg width="2000" height="2000">
      <polygon points="0 40,40 80,80 40,40 0" style=" fill: blue; stroke:black;"/>
    </svg>

    reply
    0
  • Cancelreply