What is the CSS clip property?
The clip property in
In the future, the
clipproperty is replaced byclip-pathproperty.
Syntax
clip: auto|shape|initial|inherit;
Property values
-
auto: This is the default value. It is used when we don’t want to add any clipping. -
shape: It sets the properties to clip any element. The only valid value which is allowed isrect (top, right, bottom, left) -
initial: This sets the value to its default value. -
inherit: This inherits property from its parent value.
Code
The following is the basic
Explanation
In this example, we can see that we set the properties to clip the elements. We can also set the image in the background.
We can also change the properties and set them according to our choice.