SVG rounded corner

前端 未结 12 2061
谎友^
谎友^ 2020-11-28 22:21

I have the following SVG:



        
12条回答
  •  南方客
    南方客 (楼主)
    2020-11-28 23:02

    Not sure why nobody posted an actual SVG answer. Here is an SVG rectangle with rounded corners (radius 3) on the top:

    
    

    This is a Move To (M), Line To (L), Arc To (A), Line To (L), Arc To (A), Line To (L), Close Path (Z).

    The comma-delimited numbers are absolute coordinates. The arcs are defined with additional parameters specifying the radius and type of arc. This could also be accomplished with relative coordinates (use lower-case letters for L and A).

    The complete reference for those commands is on the W3C SVG Paths page, and additional reference material on SVG paths can be found in this article.

提交回复
热议问题