background-clip

Determining whether the background should fill the area of the entire element or not extend beyond the content area.

Time to read: less than 5 min

Briefly

The background-clip property defines which areas the background image and background color will occupy.

Syntax

Possible values:

  • border-box — the background occupies all areas, including under the borders (default value).
  • padding-box — the background occupies the content area and padding, but does not go under the border. This is clearly visible with transparent or dashed borders.
  • content-box — the background fills only the content area, but does not go into the padding or under the border.
  • text — the background fills the text in the block, works only if color: transparent is specified.