The background-clip property is used to determine where and if background images are clipped inside the background area. The background-clip property also allows us to specify whether the background extends into the border or not.

Syntax:

selector {

      background-clip : border-box;

}

Values:

The background-clip property may take one of following values:

  • border-box - It is a default value position. The background is clipped relative to the border box.
  • padding-box - The background is clipped relative to the padding box.
  • content-box - The background is clipped relative to the content box.
  • initial or inherit

Example

Example with background-clip property set to the padding-box, border-box and content-box:

 

›› go to examples ››