CSS |笔画限制属性

原文:https://www . geeksforgeeks . org/CSS-stroke-miterlimit-property/

笔划限制属性用于表示斜接长度与笔划宽度之比的限制,用于绘制斜接连接。当斜接延伸超过线的厚度时,会使用此属性。如果超过指定的限制,连接的“斜接”类型将转换为“斜角”。

这将裁剪垂直于连接的连接点,而不是尖锐的连接。

语法:

stroke-miterlimit: number|initial|inherit

属性值:

  • number: It is used to define the ratio limit. It can be any value greater than or equal to 1. The default value is 4.

    例 1:

    ```html <!DOCTYPE html>

                 CSS | stroke-miterlimit property     

            rect {             stroke-linejoin: miter;             stroke-width: 20px;             stroke: green;             fill: none;         }     

        

            GeeksforGeeks     

            CSS | stroke-miterlimit     

            Each angle of the square is of 90 degrees.         Increasing the miterlimit progressively         converts the miter joints to bevel ones.     

            

                    stroke-miterlimit: 1             

                    stroke-miterlimit: 2                      

        

    ```

    输出: with-square

    例 2:

    ```html <!DOCTYPE html>

                 CSS | stroke-miterlimit property     

            polygon {             stroke-linejoin: miter;             stroke-width: 8px;             stroke: green;             fill: none;         }     

        

            GeeksforGeeks     

            CSS | stroke-miterlimit     

            Each of the triangles have two angles         equal to 24 degrees and one angle          equal to 130 degrees. Increasing the         miterlimit progressively converts the         miter joints to bevel ones.     

                         

                    stroke-miterlimit: 1             

                    stroke-miterlimit: 2             

                                 stroke-miterlimit: 3                      

        

    ```

    输出: with-triangle

  • 初始值:用于将属性设置为默认值。

  • inherit: 用于设置属性从其父元素继承。

支持的浏览器:笔画限制属性支持的浏览器如下:

  • 谷歌 Chrome
  • 火狐浏览器
  • 歌剧
  • Internet Explorer 9