How to create a custom shape - css

前端 未结 3 2080
悲哀的现实
悲哀的现实 2020-12-17 05:04

I would like to create a custom shape like this image :

\"enter

how can I do ?

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-17 05:35

    You could skip the CSS and use svg:

    Plunker

    HTML:

    
    
      
    
    

    Note that if you need rounded on corners, svg polygons can be tricky as they do not inherently have an attribute similar to border-radius. You can set stroke-linejoin="round" and then adjusting the stroke width attribute to adjust how much it rounds. This works good for solid shapes where you can set the stroke color the same as the fill, or if you can have a border of a different color.

    HTML:

    
    
      
    
    

提交回复
热议问题