New! My 44-page ebook "CSS in 44 minutes" is out! 😃

Get it now →

#background-clip

Defines how far the background should extend within the element.

default background-clip: border-box;

The background extends completely throughout the element, even under the border.

background-clip: padding-box;

The background only extends to the edge of the border: it includes the padding but not the border.

background-clip: content-box;

The background only extends to the edge of the content: it doesn't include the padding, nor the border.