CSS |填充-不透明度属性

原文:https://www.geeksforgeeks.org/css-fill-opacity-property/

填充-不透明度属性用于设置应用于形状的绘制服务器的不透明度。

语法:

fill-opacity: [0-1] | <percentage>

属性值:

  • Value between 0 and 1: It is used to set the opacity of the fill-in decimal values. The value 0 means that the fill is completely transparent and invisible. The value 1 means that the fill is fully opaque and visible. A decimal value between these two values would give a semi-transparent fill.

    示例:

    ```html <!DOCTYPE html>

           CSS | fill-opacity           .opacity1 {       / completely          visible fill /       fill-opacity: 1.0;

    fill: green;     }

    .opacity2 {       fill-opacity: 0.5;

    fill: green;     }

    .opacity3 {       fill-opacity: 0.25;

    fill: green;     }

    .opacity4 {       / completely         transparent fill /       fill-opacity: 0;

    fill: green;     }      

        GeeksforGeeks   

           CSS | fill-opacity      
                                            
    ```

    输出: in-values

  • percentage: It is used to set the opacity of the fill in percentage values. A value of 0% means that the fill is completely transparent and invisible. A value of 100% means that the fill is fully opaque and visible. A percentage value between these two values would give a semi-transparent fill.

    示例:

    ```html <!DOCTYPE html>

           CSS | fill-opacity           .opacity1 {       / completely visible         fill /       fill-opacity: 100%;

    fill: green;     }

    .opacity2 {       fill-opacity: 50%;

    fill: green;     }

    .opacity3 {       fill-opacity: 25%;

    fill: green;     }

    .opacity4 {       / completely         transparent fill /       fill-opacity: 0%;

    fill: green;     }   

      

        GeeksforGeeks   

           CSS | fill-opacity      
                                            
    ```

    输出: in-percentage

支持的浏览器:填充不透明度属性支持的浏览器如下:

  • 火狐浏览器
  • 旅行队
  • 歌剧
  • Internet Explorer 9