Open In App

CSS mask-clip property

The mask-clip CSS property specifies the area which is affected by the mask.

Syntax:



mask-clip: geometry-box values
/* Or */
mask-clip: Keyword values
/* Or */
mask-clip: Non-standard keyword values
/* Or */
mask-clip: Multiple values
/* Or */
mask-clip: Global values

Property values: This property accepts values mentioned above and described below:

Example 1: Below example illustrates the mask-clip property using border-box :






<!DOCTYPE html>
<html>
<head>
    <style>
        .geeks {
            width: 50%;
            height: 100px;
            background: green;
            border: 10px solid red;
            padding: 10px;
            -webkit-mask-image: url(image.svg);
            mask-clip: border-box;
        }
    </style>
</head>
 
<body>
    <div class="geeks">
        GeeksforGeeks is Computer Science portal.
        GeeksforGeeks is Computer Science portal.
        GeeksforGeeks is Computer Science portal.
    </div>
</body>
</html>

Output:

Example 2: Below example illustrates the mask-clip property using padding-box :




<!DOCTYPE html>
<html>
<head>
    <style>
        .geeks {
            width: 50%;
            height: 100px;
            background: green;
            border: 5px solid red;
            padding: 10px;
            -webkit-mask-image: url(image.svg);
            mask-clip: padding-box;
        }
    </style>
</head>
 
<body>
    <div class="geeks">
        GeeksforGeeks is Computer Science portal.
        GeeksforGeeks is Computer Science portal.
        GeeksforGeeks is Computer Science portal.
    </div>
</body>
</html>

Output:

Browsers Supported:


Article Tags :